Closed phptek closed 4 years ago
This is related to your custom filter. ShowInSearch is ignored on update, because a false
setting will remove an item from Solr.
I would suggest removing the field. It's not necessary anymore to have this field manually configured in your index. Index-time already takes care of this.
This issue is a non-issue, due to implementation error on the dev side. The value is not supposed to be controlled from a Solr perspective.
Describe the bug
Related to #143. Changes made to a page via the "Show in search?" checkbox do not seem to be propagated back to Solr. This seems to affect such pages being included in search-results when "SiteTree_ShowInSearch" is listed as an exclusion (See the "Additional Context" section below). Regardless of how many times I check/uncheck the box, the value of "SiteTree_ShowInSearch" remains
false
, and the page in question does not show in search results within the Silverstripe application in question.$exclusions
(See below), and I can see the desired page in results within Silverstripe (Obviously the equivalent field in Solr itself remains unchanged)Using: Module dev-master @8377d6f3
To Reproduce
Scenario #1: The "Show in search?" checkbox is checked:
"SiteTree_ShowInSearch":false
Scenario #2: The "Show in search?" checkbox is unchecked:
"SiteTree_ShowInSearch":true
(It showsfalse
)Expected behavior
I should be able to check/uncheck the "Show in search?" checkbox at will, and after publishing I should be able to see/not-see the page included in listings accordingly and that the value of the "SiteTree_ShowInSearch" facet/field changes accordingly within Solr's UI with each change.
Screenshots
N/A
Desktop (please complete the following information):
Same as previously reported issues.
Smartphone (please complete the following information):
N/A
Additional context
Search logic:
app/_config/search.yml:
Looking at the logic a little, I see that when dumping out
$update
inSolrCoreService::doManipulate()
the following output is received for checking/unchecking respectively (See attached files). I note that in "check.txt", the "fields" sub-array is populated with fields/data, but "uncheck.txt" isn't. Having thought about this for a second, it pretty much explains nothing (!!) seeing that regardless of checking/unchecking, the field-value stored in Solr still doesn't change (Assuming it's supposed to).check.txt uncheck.txt