ext-solr
ext-solr copied to clipboard
[BUG] SolrFacetMaskAndCombineEnhancer not decoding facets
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. :-)
I have same bug, I'm using the same versions
Same problem for me