From solr-user-return-77352-apmail-lucene-solr-user-archive=lucene.apache.org@lucene.apache.org Thu Jan 10 19:56:02 2013 Return-Path: X-Original-To: apmail-lucene-solr-user-archive@minotaur.apache.org Delivered-To: apmail-lucene-solr-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 62E4EECC6 for ; Thu, 10 Jan 2013 19:56:02 +0000 (UTC) Received: (qmail 70560 invoked by uid 500); 10 Jan 2013 19:55:59 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 70499 invoked by uid 500); 10 Jan 2013 19:55:59 -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 70490 invoked by uid 99); 10 Jan 2013 19:55:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jan 2013 19:55:58 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of michaelj491@gmail.com designates 209.85.215.177 as permitted sender) Received: from [209.85.215.177] (HELO mail-ea0-f177.google.com) (209.85.215.177) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 10 Jan 2013 19:55:52 +0000 Received: by mail-ea0-f177.google.com with SMTP id c10so385757eaa.36 for ; Thu, 10 Jan 2013 11:55:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=CZk9kdrO4eAHFpwbrr+WVbIBPLTX6bFxjmYV/pOCt78=; b=F7hfRrLhTKo/sB529HTHKQA9hOG7sX3XUQ0CSLRI8fGlvLnuSv11Ge77cgd+HQ6NbQ zGnOsDYUx/q6I0SmtU2BgDZTNNMbDf/OwxRgI0YXB2mwkEjqMMLPEzWaJAu56zz9PEGa 0AsZn0yddrLa/hMvCkwSxsNpIRknS+MU10OuOXY8eY52o+PQYVUu0xQKNeLRQCXVHoat lnNSXcSn1XQNFEW4/mWVnG3+YqLQHcdbtEYc7L/jrnTUpotrMDxZOVOAKG/VYfwmzi5y c2xoC3LYqJWtTpoKrM9YLZDBJhkDkh54os9CqNAzLen41kA3N/rpoevtAQuw7rGqiRJS TPkg== MIME-Version: 1.0 Received: by 10.14.206.197 with SMTP id l45mr195379119eeo.17.1357847732346; Thu, 10 Jan 2013 11:55:32 -0800 (PST) Received: by 10.14.210.71 with HTTP; Thu, 10 Jan 2013 11:55:32 -0800 (PST) In-Reply-To: References: <8F0D0142CA7ECC4287A9EC1BD8CB880C182F6D9D84@USLVDCMBVP01.ingramcontent.com> Date: Thu, 10 Jan 2013 19:55:32 +0000 Message-ID: Subject: Re: OR query From: Michael Jones To: solr-user@lucene.apache.org Content-Type: multipart/alternative; boundary=047d7b34413cbedd9b04d2f48f6a X-Virus-Checked: Checked by ClamAV on apache.org --047d7b34413cbedd9b04d2f48f6a Content-Type: text/plain; charset=ISO-8859-1 name_long:"paisley, ian" *:* OR (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian paisley)) Does actually give me incorrect results for other queries. :( On Thu, Jan 10, 2013 at 7:42 PM, Michael Jones wrote: > My fields are > > required="true" multiValued="false" /> > multiValued="true"/> > multiValued="true"/> > multiValued="true"/> > multiValued="true"/> > multiValued="true"/> > multiValued="true"/> > multiValued="true"/> > multiValued="true"/> > > And doing > > name_long:"paisley, ian" > > (constituencies:(+ian +paisley) OR label:(+ian +paisley) OR office:(+ian > +paisley)) > > > > And > > name_long:"paisley, ian" > > (constituencies:(ian AND paisley) OR label:(ian AND paisley) OR > office:(ian AND paisley)) > > > return zero results. However, if I do > > name_long:"paisley, ian" > > *:* OR (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian > paisley)) > > > > I do get results, but I'm not sure if putting *:* at the start will break > things down the line with other queries. > > > On Thu, Jan 10, 2013 at 6:36 PM, Dyer, James > wrote: > >> If the fields you're querying are of type String (1 token), then you need >> to escape the whitespace with a backslash, like this: >> >> label:ian\ paisley >> >> >> If they are of type Text (multiple tokens), sometimes you need to >> explicitly insert "AND" between each token, either with: >> >> label:(ian AND paisley) >> >> or >> >> label:(+ian +paisley) >> >> I think this is the case with edismax, which somewhat supports boolean >> queries but with caveats... >> >> You can also turn debugQuery on to figure out why things are not matching. >> >> James Dyer >> E-Commerce Systems >> Ingram Content Group >> (615) 213-4311 >> >> >> -----Original Message----- >> From: Michael Jones [mailto:michaelj491@gmail.com] >> Sent: Thursday, January 10, 2013 11:48 AM >> To: solr-user@lucene.apache.org >> Subject: Re: OR query >> >> I've tried both ways and I still get zero results with this. >> Even though name_long:"paisley, ian" will return results. >> >> name_long:"paisley, ian" >> >> (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian >> paisley)) >> >> >> >> On Thu, Jan 10, 2013 at 3:27 PM, Jack Krupansky > >wrote: >> >> > You're using query and filter query backwards - the query is what you >> are >> > looking for (the OR), while the filter query is the constraint on the >> query >> > - the drill down. >> > >> > >> > -- Jack Krupansky >> > >> > -----Original Message----- From: Michael Jones >> > Sent: Thursday, January 10, 2013 7:38 AM >> > To: solr-user@lucene.apache.org >> > Subject: Re: OR query >> > >> > >> > Thanks, I've tried doing >> > >> > >> > xml >> > >> > (constituencies:(ian paisley) OR label:(ian paisley) OR office:(ian >> > paisley)) >> > >> > name_long:"paisley, ian" >> > >> > >> > >> > >> > and >> > >> > +ian +paisley "paisley, ian" >> > name_long:"paisley, ian" >> > >> > But neither return any results >> > >> > >> > On Thu, Jan 10, 2013 at 11:53 AM, Jack Krupansky < >> jack@basetechnology.com> >> > **wrote: >> > >> > Use filter queries to filter or drill down: >> >> >> >> http://wiki.apache.org/solr/****CommonQueryParameters#fq< >> http://wiki.apache.org/solr/**CommonQueryParameters#fq> >> >> > http://wiki.apache.org/solr/CommonQueryParameters#fq> >> >> > >> >> >> >> >> >> Also consider using dismax/edismax queries, which are designed to >> match on >> >> any of multiple fields. >> >> >> >> Also be careful to put a space between each left parenthesis and field >> >> name since there is a known bug that causes such queries to fail. >> >> >> >> -- Jack Krupansky >> >> >> >> -----Original Message----- From: Michael Jones >> >> Sent: Thursday, January 10, 2013 6:24 AM >> >> To: solr-user@lucene.apache.org >> >> Subject: OR query >> >> >> >> >> >> Hi, >> >> >> >> I have a query that searches through every field to find the text >> 'london' >> >> >> >> (constituencies:(london) OR label:(london) OR name:(london) OR >> >> office:(london)) >> >> >> >> Which works fine, but when I want to filter my results. Say I want to >> >> filter down to constituencies that exactly match 'london', but also >> search >> >> the rest of the fields to make sure that the keyword still matches >> >> elsewhere >> >> >> >> (label:(london) OR name:(london) OR office:(london)) AND >> >> (constituencies:"london") >> >> >> >> Sometimes I get zero results because label, name and office don't have >> the >> >> keyword 'london', but I know constituencies does, so results should be >> > >> >> 0. >> >> But if try: >> >> >> >> (constituencies:(london) OR name:(london) OR office:(london)) AND >> >> (label:"london") >> >> >> >> returns results because constituencies is in one of the OR queries. >> >> >> >> Is there a way to say if none of the OR quires bring back a result at >> >> least >> >> search the AND? >> >> >> >> Thanks >> >> >> >> >> > >> >> > --047d7b34413cbedd9b04d2f48f6a--