ext-solr icon indicating copy to clipboard operation
ext-solr copied to clipboard

[BUG] SolrFacetMaskAndCombineEnhancer not decoding facets

Open dev-rke opened this issue 2 years ago • 4 comments

Describe the bug When i set a facet filter using the SolrFacetMaskAndCombineEnhancer, results should be filtered by the facet. Url is generated and facets are displayed in the frontend. But applying the filter does not filter the results and the facet in the url is not selected. In my opinion decoding of the url is not working.

Has anybody a working implementation i could try on my environment?

To Reproduce Apply some categories to some pages and index them using the following index config:

categories_stringM = SOLR_RELATION
categories_stringM {
    localField = categories
    multiValue = 1
}

Add a facet config:

cats {
    label = Categories
    field = categories_stringM
    type = options
}

Create the following RouteEnhancer:

routeEnhancers:
  Solr:
    type: SolrFacetMaskAndCombineEnhancer
    extensionKey: tx_solr
    routePath: '/cats/{cats}'
    _arguments:
      cats: filter-cats
    requirements:
      cats: '.*'
    solr:
      query:
        concat: true
        mask: true
        map:
          cats: filter-cats

I tested with and without limitToPages, no difference at all. I tested with and without the mask map, also no difference.

Generated urls look like this: /cats/FirstCat?tx_solr%5Bq%5D=%2A&cHash=46816f314d37b891e10b5ec23d07e25c url decoded for readability: /cats/FirstCat?tx_solr[q]=*&cHash=46816f314d37b891e10b5ec23d07e25c

IMHO the Enhancer does not detect the category, therefore the cHash is generated. I saw in SearchUriBuilder cHash generation is suppressed typically.

I always cleared all caches after config changes and before reloading. Filtering without RouteEnhancer configuration works like a charm, in this case cHash won't be generated.

Expected behavior Decoding categories or other facets should work, results should be filtered by the given category.

Used versions:

  • TYPO3 Version: 11.5.24
  • EXT:solr Version: 11.5.1
  • Used Apache Solr Version: 8.11.1 via Docker
  • PHP Version: tested with 8.0 and 8.1

Any ideas will be helpful, thank you. :-)

dev-rke avatar Mar 04 '23 00:03 dev-rke

I have same bug, I'm using the same versions

kfaresahmad avatar Jun 30 '23 14:06 kfaresahmad

Same problem for me

ddoronenko avatar Jul 21 '23 15:07 ddoronenko