# Enable Searching Contacts and Companies by Custom Field Values Without Field Alias Prefix

**URL:** <https://forum.mautic.org/t/enable-searching-contacts-and-companies-by-custom-field-values-without-field-alias-prefix/34430>\
**Category:** Ideas and Feature Requests\
**Tags:** contacts-and-fields\
**Created:** [December 13, 2024, 7:32am UTC](https://forum.mautic.org/t/enable-searching-contacts-and-companies-by-custom-field-values-without-field-alias-prefix/34430 "2024-12-13T07:32:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul.shinde](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rahul.shinde/32/10438_2.png) [@rahul.shinde](https://forum.mautic.org/u/rahul.shinde)\
**Post date:** [December 13, 2024, 7:32am UTC](https://forum.mautic.org/t/enable-searching-contacts-and-companies-by-custom-field-values-without-field-alias-prefix/34430/1 "2024-12-13T07:32:15Z")

</div>

### **Problem Statement:**

Currently, Mautic’s search functionality only allows users to search for contacts or companies directly based on the values saved in custom fields, specifying the field alias and a colon (e.g., client\_id:my-client-id).

### **User Story**

**As a user,**

**I want to** search for contacts and companies directly using the value saved in custom fields without needing to prefix the field alias and colon,

**So that** I can quickly locate specific records with a straightforward search query.

### I think these groups of people would benefit from this idea:

Mautic User and admin

### Why I think they would benefit from this idea:

- Enhanced Usability and User Experience

### Are you willing to work on this idea?:

Yes, I can take the initiative.

#### Proposed Solutions

1. New Configuration for Custom Fields:  
Add a “Searchable in Search” toggle in the custom field setup UI.  

2. Update Search Query Logic  
Modify `\Mautic\LeadBundle\Entity\LeadRepository::addCatchAllWhereClause` and `\Mautic\LeadBundle\Entity\CompanyRepository::addCatchAllWhereClause` to include aliases for custom fields marked as searchable dynamically.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [December 13, 2024, 12:24pm UTC](https://forum.mautic.org/t/enable-searching-contacts-and-companies-by-custom-field-values-without-field-alias-prefix/34430/3 "2024-12-13T12:24:24Z")

</div>

Searchable in search isn’t great use of grammar, I’d probably use ‘Available in search’ instead?

---

<div class="post-metadata">

**Author:** ![rahul.shinde](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rahul.shinde/32/10438_2.png) [@rahul.shinde](https://forum.mautic.org/u/rahul.shinde)\
**Post date:** [December 18, 2024, 10:29am UTC](https://forum.mautic.org/t/enable-searching-contacts-and-companies-by-custom-field-values-without-field-alias-prefix/34430/4 "2024-12-18T10:29:56Z")

</div>

Here is the supporting PR: [Enabling Searching Contacts and Companies by Custom Field Values Without Field Alias Prefix by shinde-rahul · Pull Request #14393 · mautic/mautic · GitHub](https://github.com/mautic/mautic/pull/14393)
