Right - didn’t read all your examples. In that case you can use span queries.
In this case complexphrase query parser should do the trick:
{!complexphrase df=text}”credit -card”
Regards,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/
> On 19 Nov 2019, at 11:08, Raboah, Avi <[email protected]> wrote:
>
> In that case I got only doc1
>
> -----Original Message-----
> From: Emir Arnautović [mailto:[email protected]]
> Sent: Tuesday, November 19, 2019 11:51 AM
> To: [email protected]
> Subject: Re: How to implement NOTIN operator with Solr
>
> Hi Avi,
> There are span queries, but in this case you don’t need it. It is enough to
> simply filter out documents that are with “credit card”. Your query can be
> something like
> +text:credit -text:”credit card”
> If you prefer using boolean operators, you can write it as:
> text:credit AND NOT text: “credit card”
>
> HTH,
> Emir
> --
> Monitoring - Log Management - Alerting - Anomaly Detection Solr &
> Elasticsearch Consulting Support Training - http://sematext.com/
>
>
>
>> On 19 Nov 2019, at 10:30, Raboah, Avi <[email protected]> wrote:
>>
>> 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 should be returned:
>>
>> doc1, doc2
>>
>> I can't find nothing about NOTIN operator implementation in SOLR docs.
>>
>>
>>
>> This electronic message may contain proprietary and confidential information
>> of Verint Systems Inc., its affiliates and/or subsidiaries. The information
>> is intended to be for the use of the individual(s) or entity(ies) named
>> above. If you are not the intended recipient (or authorized to receive this
>> e-mail for the intended recipient), you may not use, copy, disclose or
>> distribute to anyone this message or any information contained in this
>> message. If you have received this electronic message in error, please
>> notify us by replying to this e-mail.
>
>
>
> This electronic message may contain proprietary and confidential information
> of Verint Systems Inc., its affiliates and/or subsidiaries. The information
> is intended to be for the use of the individual(s) or entity(ies) named
> above. If you are not the intended recipient (or authorized to receive this
> e-mail for the intended recipient), you may not use, copy, disclose or
> distribute to anyone this message or any information contained in this
> message. If you have received this electronic message in error, please notify
> us by replying to this e-mail.