Add support for tag & exclusion for facets

Description

Introduction
your domain model has a field called " Document Type", this field is single-valued, it describes the mime-type of your document
e.g.
Doc1
docType: PDF
Doc2
docType:HTML
...

when faceting on such field, you would like to see stats over the result set with the counts:

what happens if you select one facet? your result set is reduced

this is what you get for the counts:

you lose the ability to navigate fully the result set, but you get accurate counts, not incorrect

Scope of this ticket

Ideal solution (Tag & Exclusion)

Scope of this ticket is to implement in Elasticsearch the Tag & Exclusion feature.
It is supported by Alfresco through the following parameters in a filter query:

The parameters for the filterQueries element are:

Parameter

Type

Description

Accessor

query

String

The filter query expression. For multi-select facets, selected facets must be ordered together.

org.alfresco.service.cmr.search.SearchParameters#getFilterQueries

tags

String

The tags used exclude the filters from facet evaluation for multi-select facet support.

The tags are flattened in the same SearchParameters :
see here org.alfresco.rest.api.search.impl.SearchMapper#fromFilterQuery

Some potential material to fully understand the problem:

https://sease.io/2018/12/apache-solr-facets-and-acl-filters-using-tag-and-exclusion.html

http://yonik.com/multi-select-faceting/

Solution In Elasticsearch

there is no easy support for tag & exclusion in Elasticsearch.
Similar behaviour can be achieved using filters in aggregations and PostFilters.

Activity

Show:
andrea gazzarini
February 17, 2021, 9:08 PM

The ticket has been created after a first analysis and implementation, which revealed the need of a further investigation. In the meantime, here’s the code snippet where we managed the tag exclusions (within ElasticsearchQueryExecutor):

Assignee

Unassigned

Reporter

Alessandro Benedetti

Labels

None

Release Train

None

Delivery Team

None

Priority

Unprioritized