Say I have a set of docs that go like this:
- mercedes
- mercedes trucks
Is there a way to create a query that will filter out the mercedes, but not the mercedes trucks?
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?
Have you tried:
+carbrand:mercedes* -carbrand:mercedes
(or whatever the fieldname is of course). Or am I oversimplifying based on the specific example?
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.