John AND Doe
This enhancement is only available in SuiteCRM from version 7.11 onwards.
SuiteCRM Elasticsearch engine makes use of Elasticsearch’s Query String DSL. This allows very advanced search query to be performed.
For a complete understanding check the official documentation. A quick overview will be provided here.
Search for all the records having both 'John' and 'Doe' in any field:
John AND Doe
Search for all the records having the first name 'John' (note that this won’t include 'Johnny'):
name.first:John
Search for all the records having with the name starting with 'John':
named:John*
Search for all the Accounts having 'corp' in their name:
named:corp AND _type:Accounts
By default keywords are joined by OR clauses,
meaning that searching for John Doe
will be the same as searching for John OR Doe
.
Of course results containing both 'John' and 'Doe' will appear on top.
Names are boosted, meaning that if one of the keywords match in the name the record will very likely appear on top.
By default the entire keywords must match. Thus searching with 'John' won’t match someone named 'Johnathan'.
To do that you need to use a wildcard character.
*
can be use interchangeably to replace zero or more characters.
?
can be used to replace exactly one character.
Search for both 'John' and 'Johnathan':
named:john*
Search for all the surnames starting with either 'Mc' or 'Mac':
name.last:(Mc* OR Mac*)
Wildcards can be used at the beginning of the keyword too, but it will make the search slightly slower.
Search for all the records having the last name ending with 'Connor':
name.last:*connor
You can restrict search to one or more module by using the _type
keyword and the module name.
Search for all the Users:
_type:Users
Using the ~
will make a keyword fuzzy, meaning that it will make a proximity search,
finding all matches that have one different character (distance).
The distance can be customised by adding a number after the tilde,
Search for 'MacKenzie', 'McKenzie', 'Makenzie', etc.
MacKenzie~3
Each records has the following meta fields that can be searched:
meta.created.date
meta.created.user_id
meta.created.user_name
meta.modified.date
meta.modified.user_id
meta.modified.user_name
meta.assigned.user_id
meta.assigned.user_name
Search all the records created by 'John Doe':
meta.created.user_name:(John Doe)
Search all the records modified on the first of August.
meta.modified.date:"2018-08-01"
Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.