Reputation: 93407
Say I have a set of docs that go like this:
Is there a way to create a query that will filter out the mercedes, but not the mercedes trucks?
Upvotes: 0
Views: 726
Reputation: 5813
If you need the phrase "mercedes trucks" then your query can just be
"mercedes trucks"
if you need the words mercedes and trucks then your query can be
+mercedes +trucks
OR
mercedes AND trucks
These queries will naturally filter out the docs that don't contain the word trucks.
Edit: Unless this is a keyword/untokenized field. In that case only the first example will work.
Upvotes: 1
Reputation: 31232
Have you tried:
+carbrand:mercedes* -carbrand:mercedes
(or whatever the fieldname is of course). Or am I oversimplifying based on the specific example?
Upvotes: 0