Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 49300 invoked from network); 21 Mar 2007 01:07:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Mar 2007 01:07:38 -0000 Received: (qmail 2960 invoked by uid 500); 21 Mar 2007 01:07:38 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 2930 invoked by uid 500); 21 Mar 2007 01:07:38 -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 2919 invoked by uid 99); 21 Mar 2007 01:07:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Mar 2007 18:07:38 -0700 X-ASF-Spam-Status: No, hits=4.1 required=10.0 tests=HTML_10_20,HTML_MESSAGE,HTML_OBFUSCATE_05_10 X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [69.147.74.246] (HELO web62108.mail.re1.yahoo.com) (69.147.74.246) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 20 Mar 2007 18:07:29 -0700 Received: (qmail 11585 invoked by uid 60001); 21 Mar 2007 01:07:05 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=JBXQmUl/3wfatvol4d9OMznz+QA2RrGIT3EXlgF4OQK0M3uXMEs3gzlUtBAofBc33D/pvJm5/Koup00Nf6rDv/6028cMEYDai+ysUPm+v6sqIgjl1oT8S1LxamFTovZtvpxz3+I5yRl5ZoXbcqAyqQhYnlauyVJfY9+NR213Tow=; X-YMail-OSG: MZlbb5YVM1mt6xGpjF_8hwclF7ehUcwymKDt1FLd1ISk2I.xJfmemDZTRuvlr1bN0g.YSQ3eMZHor1oQedxko9CUNHB8rNjwdRH_kk4AI.dqXDzU.uHUCrJGTQ7SZ1Tf Received: from [67.177.227.206] by web62108.mail.re1.yahoo.com via HTTP; Tue, 20 Mar 2007 18:07:05 PDT Date: Tue, 20 Mar 2007 18:07:05 -0700 (PDT) From: Santa Clause Subject: Search Question To: java-user@lucene.apache.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-22368317-1174439225=:8829" Content-Transfer-Encoding: 8bit Message-ID: <205837.8829.qm@web62108.mail.re1.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org --0-22368317-1174439225=:8829 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hello all, I have a how-to question. I have a field with these tokens in it (a b c f b g a) and I am searching on it with these tokens (a f e g a). So far this is easy I just set up a BooleanQuery with a bunch of optional TermQueries and get hits on (a f g a) but not (e) which is close to what I want. Now the part I am having difficulties with, I want to only find document that have those search tokens in order. Search (a f e g a) gets a hit, search (a f g e a) would not. A PhraseQuery expects all the search terms to be there but is close to what I want. Currently I do the set of TermQueries then filter out any document that does not have the terms in the right order as I am displaying them. I do not cycle through the entire Hits object, just enough to get something to display This works but then I never know the real count of found documents without going through all of them, which is slow. The option I am pondering is writing my own Query object but I'd rather find an easier solution. Any thoughts? Thanks, Richard K. --------------------------------- 8:00? 8:25? 8:40? Find a flick in no time with theYahoo! Search movie showtime shortcut. --0-22368317-1174439225=:8829--