Implement TAG Queries

Description

When a TAG query is detected, there should be dedicated management in the Elasticsearch QueryAdaptor.

This issue depends on the solution chosen in SEARCH-2866.

Solution 1

When a user performs a query using the TAG field, the system has to search inside the cm%3Ataggable node field. The query will be performed as a normal query.

Solution 2/2B

We are indexing TAGs inside a node as a noderef list, so the main idea is to execute two queries:

  1. perform a query on the cm:taggable path for the tag name in order to retrieve all TAG identifiers.

  2. search for each node, using a Terms query, that references at least one tag we found in the previous query.

Because it is possible to search for a TAG as a normal field the first query must work for Wildcard, Prefix and Fuzzy queries.

This approach is similar to what we are doing for Site queries.

 

Acceptance criteria

  • remove FIELD_TAG from the list of unsupported fields in org.alfresco.repo.search.impl.elasticsearch.query.language.lucene.TermOrPhraseQueryTest#unsupportedFields

  • add unit tests for FIELD_TAG in org.alfresco.repo.search.impl.elasticsearch.query.language.lucene.TermOrPhraseQueryTest

  • remove FIELD_TAG from the list of unsupported fields in org.alfresco.repo.search.impl.elasticsearch.query.language.lucene.PrefixQueryTest#unsupportedFields

  • add unit tests for FIELD_TAG in org.alfresco.repo.search.impl.elasticsearch.query.language.lucene.PrefixQueryTest

  • remove FIELD_TAG from the list of unsupported fields in org.alfresco.repo.search.impl.elasticsearch.query.language.lucene.WildcardQueryTest#unsupportedFields

  • add unit tests for FIELD_TAG in org.alfresco.repo.search.impl.elasticsearch.query.language.lucene.WildcardQueryTest

  • remove FIELD_TAG from the list of unsupported fields in org.alfresco.repo.search.impl.elasticsearch.query.language.lucene.FuzzyQueryTest#unsupportedFields

  • add unit tests for FIELD_TAG in org.alfresco.repo.search.impl.elasticsearch.query.language.luceneFuzzyQueryTest

  • Update the wiki pages listed below:

Assignee

Unassigned

Reporter

Davide Cerbo

Delivery Team

Search