I'm getting multiple entries appearing in a Content Types facet block in cases where the machine name and title of a content type aren't the same. This is on a Search API search with Search API Solr. In case it's relevant (unlikely), results are in a context view that is loaded as a context in page manager.
Examples:
- For a field with machine name "video" and title "Multimedia", I see:
- A facet link titled "Multimedia" that links to
...f[0]=type:video - A facet link titled "multimedia" that links to
...f[0]=type:multimedia - For a field with machine name "page" and title "Basic Page", I see:
- A facet link titled "basic" that links to
...f[0]=type:basic - A facet link titled "Basic Page" that links to
...f[0]=type:page
The pattern apepars to be that, when the machine name and title differ in anything but case, one correct facet link is created, and one additioanl redundant facet link is created where both title and url string are a lowercase form of the first word of the content type title.
In both cases, both facet links display the correct number of items, and both work: filtering to the correct items. I'm just not sure why they are being duplicated with this unusual pattern. It's possible this is an indexing issue, but if it is, it's only in the facets where symptoms are showing.
(for now I'm just changing them to make sure the machine names and titles match in all but case, and avoiding multiple word titles)
Comments
Comment #1
cpliakas commentedHi alanomaly.
Thanks for posting. It is important to note that Facet API only works with the data passed back to it by the backend, so can you check the data that is being returned by Search API Solr? You can check this by adding some debug code to the FacetapiFacetProcessor::initializeBuild() printing out the $build array returned by
$build = $adapter->getFacetQuery($this->facet->getFacet())->build();around line 1465.Thanks,
Chris
Comment #2
cpliakas commentedMarking as needs more info, because Facet API can only use the data that is passed to it. Therefore we need some more information in order to confirm that the bug exists in Facet API.
Comment #3
cpliakas commentedClosing as cannot reproduce since no info was provided, but please feel free to re-open the issue if steps to reproduce can be added to this thread.