I have been working on build in an extra field to the List View quicksearch on Accounts and Contacts.
Thanks to previous contributors around this.
However, I am experiencing some inconsistent behaviour and am wondering what part the split_terms and priority settings play.
For example...
Accounts
In Accounts module in the \custom\modules\Accounts\clients\base\filters\basic\basic.php I have
$viewdefs['Accounts']['base']['filter']['basic'] = array(
'create' => true,
'quicksearch_field' => array('name', 'my_custom_field'),
'quicksearch_priority' => 1,
'quicksearch_split_terms' => false,
....
and this seems to work OK
If I type in either a value based on the name field or a value based on my custom field, the List View filters down appropriately.
Contacts
On Contacts, from other posts I see the code references the first_name and last_name
So I have built in this code...
$viewdefs['Contacts']['base']['filter']['basic'] = array(
'create' => true,
'quicksearch_field' => array('first_name', 'last_name', 'my_custom_field'),
'quicksearch_priority' => 2,
'quicksearch_split_terms' => false,
....
Before I added my custom field in, List View search would behave like...
Type in 'Gordon' : this returns all contacts containing 'Gordon' (first or last name)
Type in 'Gordon V' : this returns all contacts containing 'Gordon V'
After I add my custom field in, behaviour is as follows...
Type in 'Gordon' : behaviour as before, all contacts containing 'Gordon' (first or last name)
Type in 'Gordon V' : initially returns Gordon records but when I type in space V, no records returned
If I type in one of my custom field values on it's own, it returns records containing that value.
I'm wondering if the split_terms and/or priority settings are relevant, but can find no specific documentation on those.
Thanks
Neil