eea.facetednavigation icon indicating copy to clipboard operation
eea.facetednavigation copied to clipboard

Make it possible to use same index for several criteria and do this work together

Open gbastien opened this issue 4 years ago • 3 comments

Hi @avoinea @alecghica

we have following use case :

  • we use keywords (Subjects) for various semantic cases, for example "colour" and "size", so we have "red", "green", "orange", "big", "medium" and "small" as keywords available on an element, and this is indexed under "Subjects"
  • to filter out this, we have 2 filters with custom vocabularies, one filter "colour" with "green/red/orange" as available check-boxes and one filter "size" with "big/medium/small" as available check-boxes

When doing this, it is possible to add such criteria in the interface, no problem, but when filtering, only last filter is taken into account, we can not get "red" elements "big", only "big" is taken into account because it uses same index "Subjects".

What I would like to adapt is in FacetedQueryHandler.criteria, instead updating the **query, if an index already exist in the **query, is to complete the **query with new values instead replacing existing values (and so do a AND between values).

Does that seem correct to you?

I would add documentation in the code and a test obviously.

Thank you!

Gauthier

gbastien avatar Sep 02 '20 15:09 gbastien