Exact Term Queries in Search Services 2.0

cancel
Showing results for 
Search instead for 
Did you mean: 

Exact Term Queries in Search Services 2.0

tpage
Alfresco Employee
2 5 6,024

One of the smaller changes in Search Services 2.0 is that we've changed the way the = operator behaves.  Previously this operator resulted in an exact field match, but it has always been documented as an exact term match.  For example this is from the docs page for ACS 5.2:

To search for an exact term, prefix the term with "=".

In Search Services 2.0 we have fixed the behaviour to match the documentation.  This will not have an impact when querying for fields unless they are tokenised.

For example here we have some example queries against the (tokenised) cm:name field with a corpus of two documents:

Examples of using exact term queries against a corpus of two documents.Examples of using exact term queries against a corpus of two documents.When we query for "=Driver" then we now return the document called "Taxi Driver". Previously in Search Services 1.4.0 we would not get any results.  When we query for "=Taxi =Driver" then we get both documents returned since they have the term "Taxi" in the name (and the default operator is OR). Previously we would only get results where the name was exactly "Taxi" or exactly "Driver".

Having discussed this at length within the team we realise that it can be quite hard to envisage the impact of this change in all situations, and we felt this was particularly complex when combined with phrase queries.  Here's a table showing various queries and document names with highlighting where the behaviour has changed in Search Services 2.0.

Changes in behaviour for various phrase and exact term queries.Changes in behaviour for various phrase and exact term queries.

Full details of this fix can be found in SEARCH-2228.

As mentioned this is one of the smaller changes that has gone into Search Services 2.0.0.  There is a more detailed list of features published here and for a more in-depth tour then you can register for Tech Talk Live #123: Discovering the "2" in Search Services 2.0.

5 Comments