Reputation: 13120
So this query
http://jthinkws.elasticbeanstalk.com/?type=release&query=artist:(Dinosaur~0.7 AND Jr.) AND (+track:"Forget The Swan" +track:"Just Like Heaven" ) AND tracks:[2 TO 100] AND src:1&limit=100&offset=0
gives 35 results, whereas
http://jthinkws.elasticbeanstalk.com/?type=release&query=artist:(Dinosaur~0.7 AND Jr.) AND (track:"Forget The Swan" AND track:"Just Like Heaven" ) AND tracks:[2 TO 100] AND src:1&limit=100&offset=0
gives 2 results.
It seems that in the first case it returns documents where the track field matches "Forget the Swan" or "Just Lie Heaven" whereas the second only returns when the track field matches both, so the first query is acting as if there is an implicit OR between the the two track parameters as follows
http://jthinkws.elasticbeanstalk.com/?type=release&query=artist:(Dinosaur~0.7 AND Jr.) AND (+track:"Forget The Swan" OR +track:"Just Like Heaven" ) AND tracks:[2 TO 100] AND src:1&limit=100&offset=0
but if this is so what is the point of the + operator ?
Update: Im now wondering if the issue is related to the fact that the query is made over the internet and whether the '+' is being incorrectly encoded
Upvotes: 3
Views: 581
Reputation: 33351
You are right, about needing to escape the "+" in the URL. As far as Lucene syntax is concerned, x AND y
gets interpreted to +x +y
by the query parser, so they are identical by definition.
Try replacing the plusses with %2B
:
Upvotes: 2