lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emir Arnautović <emir.arnauto...@sematext.com>
Subject Re: Solr search word NOT followed by another word
Date Tue, 13 Feb 2018 12:13:26 GMT
Hi Ivan,
You might be able to use complexphrase query parser to get what you need, you can test something
like this:

{!complexphrase df=my_field}”Leonardo -(da Vinci)”

This should return any Leonardo that is not followed by da Vinci.

HTH,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 12 Feb 2018, at 12:00, ivan <ivan@presstoday.com> wrote:
> 
> What i'm trying to do is to only get results for "Leonardo" when is not
> followed by "da vinci".
> So any result containing "Leonardo" (not followed by "da vinci") is fine
> even if i have "Leonardo da vinci" in the result. I want to filter out only
> the results where i don't have "Leonardo" without "da vinci".
> 
> Examples:
> "Leonardo abc abc abc"   OK
> "Leonardo da vinci abab"  KO
> "Leonardo is the name of Leonardo da Vinci"  OK
> 
> 
> I can't seem to find any way to do that using solr queries. I can't use
> regex (i have a tokenized text field) and any combination of boolean logic
> doesn't seem to work.
> 
> Any help?
> Thanks
> 
> 
> 
> 
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Mime
View raw message