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 9681BF1B9 for ; Tue, 9 Apr 2013 13:15:49 +0000 (UTC) Received: (qmail 70956 invoked by uid 500); 9 Apr 2013 13:15:46 -0000 Delivered-To: apmail-lucene-solr-user-archive@lucene.apache.org Received: (qmail 70743 invoked by uid 500); 9 Apr 2013 13:15:45 -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 70720 invoked by uid 99); 9 Apr 2013 13:15:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Apr 2013 13:15:45 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of koji@r.email.ne.jp designates 202.224.39.197 as permitted sender) Received: from [202.224.39.197] (HELO mail1.asahi-net.or.jp) (202.224.39.197) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Apr 2013 13:15:38 +0000 Received: from Koji-Sekiguchi-no-MacBook-Pro.local (w244069.ppp.asahi-net.or.jp [121.1.244.69]) by mail1.asahi-net.or.jp (Postfix) with ESMTP id 6752C14001 for ; Tue, 9 Apr 2013 22:15:13 +0900 (JST) Message-ID: <51641460.9080001@r.email.ne.jp> Date: Tue, 09 Apr 2013 22:15:12 +0900 From: Koji Sekiguchi User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: solr-user@lucene.apache.org Subject: Re: conditional queries? References: <1365484556.78548.YahooMailNeo@web120704.mail.ne1.yahoo.com> In-Reply-To: <1365484556.78548.YahooMailNeo@web120704.mail.ne1.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Mark, > Is it possible to do a conditional query if another query has no results? For example, say I want to search against a given field for: > > - Search for "car". If there are results, return them. > - Else, search for "car*" . If there are results, return them. > - Else, search for "car~" . If there are results, return them. > > Is this possible in one query? Or would I need to make 3 separate queries by implementing this logic within my client? As far as I know, there is no such SearchComponent. But the idea of "FallbackRequestHandler" has been told, see SOLR-1878, for example: https://issues.apache.org/jira/browse/SOLR-1878 koji -- http://soleami.com/blog/lucene-4-is-super-convenient-for-developing-nlp-tools.html