Closed (fixed)
Project:
Search API
Version:
7.x-1.x-dev
Component:
Views integration
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Oct 2016 at 02:04 UTC
Updated:
26 Nov 2016 at 09:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
damienmckennaComment #3
damienmckennaI've also posted this to Drupal Answers: http://drupal.stackexchange.com/questions/218845/a-at-start-of-node-titl...
Comment #4
damienmckennaI'm getting somewhere.
Using Solr Devel I've worked out that the requests's query string is being modified before it's sent to Solr:
(("banana") OR ("the") OR ("tree"))"banana the tree"So it seems like something is stripping out words and completely changing the possible results.
Comment #5
damienmckennaMoving this to the main module as I think the problem may stem from the Views integration.
Comment #6
damienmckennaDigging through the functionality, the search string is being changed in SearchApiViewsHandlerFilterFulltext::exposed_validate(). It turned out that the string is a) being split up via preg_split(), and b) the view had a minimum length set I wasn't aware of :)
So, this then brings up something - using preg_split() is a little insufficient, at the very least it doesn't retain strings passed in with quotes; the search.module uses an extensive amount of logic to do this, never mind Lucene ;-)
Comment #7
damienmckennaIn debugging it further I'm seeing differences between the results provided by the hosted Solr service and my local instance, so I'm going to dig into this further.
Comment #8
drunken monkeyThanks for reporting this problem, and debugging it so thoroughly!
You're right, of course, we can't just remove parts of quoted strings from the keywords.
The attached patch should fix this, please test!
Comment #9
damienmckennaOk, that appears to be helping, it is at least now passing the quoted phrase through to the "q" argument, so thanks for that. We're still not getting the exact results, but I think there are other issues.
Comment #11
drunken monkeyGood to hear it helped, thanks for reporting back!
Committed.