nyeholt / silverstripe-solr

SilverStripe and Solr integration ssaumodule
BSD 3-Clause "New" or "Revised" License
19 stars 18 forks source link

Issue with searching Page and custom dataobjects #22

Open alankoeninger opened 10 years ago

alankoeninger commented 10 years ago

There's a problem when trying to search across pages and dataobjects. In the search settings, if I set a Page and my custom dataobject in the "Search items of type" field on the Search settings page, it fails to find any matches for the dataobject.

When I examine the solr query log, this is what I saw:

&fq=ClassNameHierarchy_ms:Page+OR+MyCustomDataObject

but it should probably be:

&fq=ClassNameHierarchy_ms:Page+OR+ClassNameHierarchy_ms:MyCustomDataObject

This is in /solr/code/pages/SolrSearchPage.php, at line #415.

$builder->addFilter('ClassNameHierarchy_ms', implode(' OR ', $types));

Cheers, Alan

alankoeninger commented 10 years ago

Sorry, forgot to mention this relates to the 3.2.1 tag.