Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B4327200BC8 for ; Wed, 23 Nov 2016 16:37:33 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B2AA0160AFD; Wed, 23 Nov 2016 15:37:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D567E160AEC for ; Wed, 23 Nov 2016 16:37:32 +0100 (CET) Received: (qmail 1277 invoked by uid 500); 23 Nov 2016 15:37:30 -0000 Mailing-List: contact solr-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: solr-user@lucene.apache.org Delivered-To: mailing list solr-user@lucene.apache.org Received: (qmail 1260 invoked by uid 99); 23 Nov 2016 15:37:30 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Nov 2016 15:37:30 +0000 Received: from mail-yw0-f171.google.com (mail-yw0-f171.google.com [209.85.161.171]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 7FBA11A00A8 for ; Wed, 23 Nov 2016 15:37:30 +0000 (UTC) Received: by mail-yw0-f171.google.com with SMTP id i145so14493956ywg.2 for ; Wed, 23 Nov 2016 07:37:30 -0800 (PST) X-Gm-Message-State: AKaTC03sa8q6YXIByvt2U9M0bonxPjffPrASPIlxhBvAbZR9nXF8b5qSXiTXV5HMg5FWqDgJP8WISC1MIvxQBQ== X-Received: by 10.129.130.133 with SMTP id s127mr3925213ywf.41.1479915449705; Wed, 23 Nov 2016 07:37:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.173.163 with HTTP; Wed, 23 Nov 2016 07:37:29 -0800 (PST) In-Reply-To: References: <006b01d2453e$01899b50$049cd1f0$@teschglobal.com> <16F3358D-B657-4DCC-97F0-1B1F1ADA9AE5@teschglobal.com> <00ba01d24597$f202be50$d6083af0$@teschglobal.com> From: Alessandro Benedetti Date: Wed, 23 Nov 2016 15:37:29 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: negation search help To: "solr-user@lucene.apache.org" , Rafa Haro Content-Type: multipart/alternative; boundary=94eb2c07c4b8ad98610541f9aad0 archived-at: Wed, 23 Nov 2016 15:37:33 -0000 --94eb2c07c4b8ad98610541f9aad0 Content-Type: text/plain; charset=UTF-8 I add to the thread a friend of mine, Rafa just presented at the Apachecon a medical system which deal exactly with a negation engine ( he will publish the slides soon) Hope it helps ! Cheers On Wed, Nov 23, 2016 at 3:03 PM, Alexandre Rafalovitch wrote: > Well, then 'no' becomes a signal token. So, the question is how many > tokens after that it affects in its circle of negation? > > You could probably use something like > https://cwiki.apache.org/confluence/display/solr/Other+ > Parsers#OtherParsers-SurroundQueryParser > to say (if user said 'headache'). > -{!surround} 3w(not, headache) > > But I am not sure how this would work in terms of multi-term queries. > > Alternatively, you could transform your input with custom token filter > that, after seeing the term 'no', 'not', will just eat that and next > n? tokens. > > Or you could run the sentences through natural language recognition > and remove/mark noun phrases that are negative. > > What I am trying to say is that Solr can do a bunch of different > things for you. But you first need to translate your domain problem > into a much lower level pseudo-language problem that addresses your > needs. Including the edge-cases, which none of us can guess from your > description. Then you can implement it in Solr. > > Hope this helps, > Alex. > > ---- > http://www.solr-start.com/ - Resources for Solr users, new and experienced > > > On 24 November 2016 at 01:43, Hem Naidu > wrote: > > Correct Alex. The use case is when provider searches on patient medical > information for certain symptoms, the mentions likes "no headache" , "no > blood loss", "not diabetic" should not show up in the search results. > > > > Thanks > > > > > > -----Original Message----- > > From: Alessandro Benedetti [mailto:benedetti.alex85@gmail.com] > > Sent: Wednesday, November 23, 2016 8:22 AM > > To: solr-user@lucene.apache.org > > Subject: Re: negation search help > > > > Now that I read better, do you mean that at indexing time those > negations must be recognized, in the way that they are no match ? > > > > Cheers > > > > On Wed, Nov 23, 2016 at 2:20 PM, Alessandro Benedetti < > benedetti.alex85@gmail.com> wrote: > > > >> Hi Hem, > >> are you expecting Solr to parse your natural language query out of the > >> box ? > >> Are you using any custom query parser ? > >> > >> If not, you need to follow the lucene Syntax to define engative queries. > >> > >> And be careful to the edge cases [1] . > >> > >> Cheers > >> > >> [1] https://wiki.apache.org/solr/NegativeQueryProblems > >> > >> On Wed, Nov 23, 2016 at 1:54 PM, Hem Naidu >> invalid> wrote: > >> > >>> Alex > >>> > >>> Whenever the keywords or sentence followed by "no", "not", etc should > >>> be excluded from the search results. Does solr support this feature? > >>> > >>> Thanks > >>> > >>> > >>> Sent from my iPhone > >>> > >>> > >>> > On Nov 23, 2016, at 12:09 AM, Alexandre Rafalovitch > >>> > > >>> wrote: > >>> > > >>> > How do you _know_ it is not 'apparent' ? Is it because it is > >>> > preceded by the keyword 'no'? Just that keyword? At what maximum > distance? > >>> > > >>> > Regards, > >>> > Alex > >>> > > >>> > On 23 Nov 2016 2:59 PM, "Hem Naidu" > >>> > > >>> > wrote: > >>> > > >>> >> Gurus, > >>> >> > >>> >> I am new to Solr, I have a requirement to index entire pdf/word > >>> documents > >>> >> using Solr Tika. Which was successful and able to get the search > >>> results > >>> >> displayed. Now I need to fine tune the results or adjust index so > >>> >> the negative statements should be filtered out the results like my > >>> >> input > >>> text > >>> >> for index from the documents would be > >>> >> ----------------------------------- > >>> >> Fortunately no concurrent trauma was found In no apparent distress > >>> >> -------------------------------------- > >>> >> > >>> >> If user searches for concurrent trauma or distress the search > >>> >> engine > >>> should > >>> >> filter out the results as it not apparent symptom. > >>> >> > >>> >> Any help on whether Solr can do this? > >>> >> If so, do I need to adjust the index or build custom queries? > >>> >> > >>> >> Any help on this would be greatly appreciated ! > >>> >> > >>> >> Thanks > >>> >> > >>> >> > >>> >> > >>> > >> > >> > >> > >> -- > >> -------------------------- > >> > >> Benedetti Alessandro > >> Visiting card - http://about.me/alessandro_benedetti > >> Blog - http://alexbenedetti.blogspot.co.uk > >> > >> "Tyger, tyger burning bright > >> In the forests of the night, > >> What immortal hand or eye > >> Could frame thy fearful symmetry?" > >> > >> William Blake - Songs of Experience -1794 England > >> > > > > > > > > -- > > -------------------------- > > > > Benedetti Alessandro > > Visiting card - http://about.me/alessandro_benedetti > > Blog - http://alexbenedetti.blogspot.co.uk > > > > "Tyger, tyger burning bright > > In the forests of the night, > > What immortal hand or eye > > Could frame thy fearful symmetry?" > > > > William Blake - Songs of Experience -1794 England > > > -- -------------------------- Benedetti Alessandro Visiting card : http://about.me/alessandro_benedetti "Tyger, tyger burning bright In the forests of the night, What immortal hand or eye Could frame thy fearful symmetry?" William Blake - Songs of Experience -1794 England --94eb2c07c4b8ad98610541f9aad0--