Return-Path: X-Original-To: apmail-lucene-java-user-archive@www.apache.org Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 275BD17D4B for ; Wed, 18 Feb 2015 10:10:15 +0000 (UTC) Received: (qmail 79060 invoked by uid 500); 18 Feb 2015 10:02:54 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 79008 invoked by uid 500); 18 Feb 2015 10:02:54 -0000 Mailing-List: contact java-user-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: java-user@lucene.apache.org Delivered-To: mailing list java-user@lucene.apache.org Received: (qmail 55415 invoked by uid 99); 18 Feb 2015 09:56:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Feb 2015 09:56:14 +0000 X-ASF-Spam-Status: No, hits=-0.4 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,URI_TRY_3LD X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ian.lea@gmail.com designates 209.85.212.169 as permitted sender) Received: from [209.85.212.169] (HELO mail-wi0-f169.google.com) (209.85.212.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Feb 2015 09:55:49 +0000 Received: by mail-wi0-f169.google.com with SMTP id em10so37814242wid.0 for ; Wed, 18 Feb 2015 01:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=bN0YjBjoej1FQICn2GyefzjnAKUeoYjOEOGqEHjRIOg=; b=G+6C4xtoS0MhDC1hflaKIh9yq98YTpQ07P+8ohbHA0J9KKBGhbRc36X50DViZfrqHE Qi+U9lqbNZG9VIsxMlKc0p7UkEn+vCbr61ksubS+miROuc7AEVrt1eBzesm6FQ0nmr82 v4KhmObUA5+JtXrC2SYpp6v/Bjy5syADMcmOl+qfSHgtuXl62kqmTg0uufzHwvDY+U99 Vh/+5IGtH00hHfpnwp+3IHSETFzheLtJlaRh/QGcaS191csyTD8AVMBZTj5CjriLKZ6d He//+DRl+OSFrqlLUkVsNQL0g3vfXuEEMO7ybMnQT497wt0fn8DeUyMqw/9FDhpRNaip mOfg== X-Received: by 10.180.105.166 with SMTP id gn6mr3120766wib.47.1424253301765; Wed, 18 Feb 2015 01:55:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.27.228.2 with HTTP; Wed, 18 Feb 2015 01:54:41 -0800 (PST) In-Reply-To: References: From: Ian Lea Date: Wed, 18 Feb 2015 09:54:41 +0000 Message-ID: Subject: Re: Indexing Query To: java-user@lucene.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org You mean you'd like a BooleanQuery.setMaximumNumberShouldMatch() method? Unfortunately that doesn't exist and I can't think of a simple way of doing it. -- Ian. On Wed, Feb 18, 2015 at 5:26 AM, Deepak Gopalakrishnan wrote: > Thanks Ian. Also, if I have a unigram in the query, and I want to make sure > I match only index entries that do not have more than 2 tokens, is there a > way to do that too? > > Thanks > > On Wed, Feb 18, 2015 at 2:23 AM, Ian Lea wrote: > >> Break the query into words then add them as TermQuery instances as >> optional clauses to a BooleanQuery with a call to >> setMinimumNumberShouldMatch(2) somewhere along the line. You may want >> to do some parsing or analysis on the query terms to avoid problems of >> case matching and the like. >> >> >> -- >> Ian. >> >> >> On Tue, Feb 17, 2015 at 4:57 PM, Deepak Gopalakrishnan >> wrote: >> > Hello, >> > >> > I have a rather simple query. I have a list where I have terms like and >> > then my query is more natural language. I want to be able to retrieve >> > matches that has atleast 2 words in common between the query and the >> index >> > >> > Can you guys suggest a Query Type and a field that I should be using? >> > >> > -- >> > Regards, >> > *Deepak Gopalakrishnan* >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org >> For additional commands, e-mail: java-user-help@lucene.apache.org >> >> > > > -- > Regards, > *Deepak Gopalakrishnan* > *Mobile*:+918891509774 > *Skype* : deepakgk87 > http://myexps.blogspot.com --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org