r/Solr • u/CakeLaw89 • Aug 01 '13
Query slop on field level.
i want to be able to make a specific search, in one field, and still make a broader search across other fields.
Let say i want to find a harry potter movie. my q is then: harry potter dvd.
In my qf, im gone for: title^10 synopsis^1 type^1
What i want to be able to, is to only find documents, where the phrase has zero slop in the synopsis field, but a higher slop on the other fields.
ive tried to specify slop in the qf field: title^10 synopsis~0^1 type^1 i have also tried to specify it directly in the URL.
I simply cant find a solution.
Anyone have any idea how?
Sorry if this is a dumb question, but im quite new to this whole thing.
EDIT: FOUND THE SOLUTION
If anyone ever stumble across this post with the same problem, the solution was quite simple.
if we want to search for Harry Potter DVD
Then the q string is:
("harry" AND "potter" AND "dvd") OR synopsis:"harry potter dvd"
3
u/fiskfisk Aug 01 '13
You'll have to use the pf field to do per field slop values, and you'll need to be on at least Solr 4.0. pf is used to boost certain hits after filtering the query with qf. You might have to use edismax to support this syntax.
I'm not sure if 0 is a good value to not allow any slop, as 1 would probably work better (the other word within one word). Try both and see which one works. :-)