Firesphere / silverstripe-subsite-solr

Support for Subsites in silverstripe-solr-search
GNU General Public License v3.0
0 stars 1 forks source link

Current subsite is not actually applied #3

Closed phptek closed 4 years ago

phptek commented 4 years ago

firesphere/silverstripe-solr-search + firesphere/silverstripe-subsite-solr dev-master, Silverstripe 4.4.3 on PHP7.2

Using a single subsite, search results are not filtered correctly when performing a search from a given subsite.

Note, bug was filed in the context of a DEV env, using the ?SubsiteID=1 URL hack.

phptek commented 4 years ago

Note: Ref's conversation in Slack here: https://silverstripe-users.slack.com/archives/C9KB3U0P8/p1579562395002000

Note also the following repro steps:

Steps to reproduce:

http://localhost:8983/solr/MyIndex/select?fl=SiteTree_SubsiteID&q=*%3A*

{
  "responseHeader":{
    "status":0,
    "QTime":0,
    "params":{
      "q":"*:*",
      "fl":"SiteTree_SubsiteID"}},
  "response":{"numFound":5944,"start":0,"docs":[
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {}]
  }}
Firesphere commented 4 years ago

Do you have a non-Subsite object in your index? It seems like the results are correct, but because there is no Subsite associated, the result is not what is expected....

Just a hunch :) Not sure if it's related, but it seems to matter for me

Firesphere commented 4 years ago

I think I got it fixed: image Please test?