[Vtigercrm-developers] Logical operators in List View searches?
Alan Lord
alanslists at gmail.com
Fri Jan 26 09:03:38 GMT 2024
On 24/01/2024 16:51, Rubén A. Estrada Orozco wrote:
> I think maybe an additional select input with the options "does not
> contain", "exact match", "starts with", "ends with", "greater than",
> "less than", would be more user friendly. I wouldn't know how to resolve
> the OR, AND, etc.. in a user friendly way.
Hmm, but would you need to have this select in every column?
And what about if you wanted to combine search parameters? i.e.
-notthisstring AND (string1 OR string2).
To follow up on Martin's suggestion, I just realised that our Vlastic
Search extension module, that uses ElasticSearch in the backend, also
uses a very similar syntax to Google...
Here's an extract from our manual:
> Depending on the configuration of Vlastic Search various parameters may be used to help you
> narrow down, or broaden, the scope of your search.
> The default search method of Vlastic Search is called Simple Query String and it supports the
> following special characters:
> + signifies AND operation
> If you place a + between two words the search result will show only those records where
> both words exist
> | signifies OR operation
> If you place a | between two words the search result will show records where either word
> exists
> - negates a single token
> Putting a minus sign in front of a word means find all records that do not contain that
> word
> " wraps a number of tokens to signify a phrase for searching
> If you want to search for a phrase of more than one word enclose the whole phrase in
> quotation marks
> * at the end of a term signifies a prefix query
> The asterisk is a wild card. Putting an asterisk at the end of a word or part of word or
> phrase means find everything beginning with
> ( and ) signify precedence
> Use brackets to determine the precedence of the search terms – just like in mathematics
>
> Here are some example searches to indicate the use of these special characters:
> london+hotel
> This will find all records within vtiger where the terms “london” AND “hotel” are present
> in the same record. Omitting the + (using a space) signifies the default operator which in
> Vlastic Search's case is the OR operator
> “Novotel London”
> This search term, wrapped in quotation marks will find all records within vtiger that
> contain this exact phrase. To explain a bit more it would not find a record where the
> Organisation name is “Novotel Hammersmith London” but it would find a record where
> the Organisation name was “Hammersmith Novotel London”
> 0207* | 0208*
> Find all records in vtiger which contain a number sequence beginning 0207 or 0208. This
> would be useful if you were looking for all records which have a London telephone
> number for example.
> (020 7* + London) -Smith
> This is a more complicated example to show the use of multiple operators. This query
> term looks for all records which contain a number beginning with “020 7” AND also
> contain the word “London”. Then remove any records in this result which contain the
> word “Smith”.
> WC1*
> Find all records in vtiger that have a string of characters beginning with “WC1”. This could
> be used to look for any record containing a London WC1 postcode.
Al
More information about the vtigercrm-developers
mailing list