0

I am trying to find the documents which hit this example:

q=text:"credit" NOTIN "credit card"

for that query I want to get all the documents which contain the term "credit" but not as part of the phrase "credit card".

so:

  1. I don't want to get the documents which include just "credit card".

  2. I want to get the documents which include just "credit".

  3. I want to get the documents which include "credit" but not as part of credit card.

for example:

doc1 text: "I want to buy with my credit in my card"

doc2 text: "I want to buy with my credit in my credit card"

doc3 text: "I want to buy with my credit card"

The documents returned should be:

doc1, doc2

I can't find nothing about NOTIN operator implementation in SOLR docs.

  • 1
    `text:credit -text:"credit card"`? – MatsLindh Nov 13 '19 at 12:03
  • 1
    Why not just not ? ;) As Mats suggested, you need to match documents that contains in their 'text' field the term "credit" but not the *phrase* "credit card". Did you try it ? It should work, provided that your 'text' field analyser is precise enough to make a pf match with slope of 0 (because otherwise the phrase "credit card" could match both "credit in my card" and "credit in my credit card" with a slope > 2) – EricLavault Nov 13 '19 at 12:55
  • thanks guys, but text:credit -text:"credit card"~0 return just doc1 :( – user3493678 Nov 14 '19 at 09:04

0 Answers0