From java-user-return-48654-apmail-lucene-java-user-archive=lucene.apache.org@lucene.apache.org Wed Feb 09 08:44:19 2011 Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 24751 invoked from network); 9 Feb 2011 08:44:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2011 08:44:19 -0000 Received: (qmail 68757 invoked by uid 500); 9 Feb 2011 08:44:17 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 68246 invoked by uid 500); 9 Feb 2011 08:44:13 -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 68232 invoked by uid 99); 9 Feb 2011 08:44:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Feb 2011 08:44:12 +0000 X-ASF-Spam-Status: No, hits=4.4 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [68.142.200.119] (HELO web30506.mail.mud.yahoo.com) (68.142.200.119) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 09 Feb 2011 08:44:02 +0000 Received: (qmail 41508 invoked by uid 60001); 9 Feb 2011 08:43:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1297241021; bh=3JfEsZ1iZqhto8vDb+erZ04oROoTADcO7yx4G/RHNjA=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=mItg0sC55qgoAjySInobT3sGdh/1nEYIYktoR7TxnqTX8WzPLlCxI8d5lpOpc0qHtkp1p27ssbKrQbZZ6QX/DKuC59bjGCiPvpWZuk8Zqlr5oS2k3HdiveGrLUjgeTVi0hZ7SogSeKM0YxliCRmZhTcNJ38cn5iGgVbEee0lOOE= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=rCNW+sYg8lDucmWRlyMk22dR87sgNGkBQCtAL+qX1Pm0xIyLbLZA8fvp2AD4zt1HdLQQDAO22t4yEnVaKkqCF7TU8nXmJ4IgyKMUnFDTbWZfshBGsz7CDPix3sWc8ci1VocbyRquUQhDtCKTMj0OgMamftwP/uvigOkrXRw2dL0=; Message-ID: <241926.37404.qm@web30506.mail.mud.yahoo.com> X-YMail-OSG: 5oEb0JkVM1mt3bM4C1IrCSweGri61.ypK1nBSB4zB_Se1Ds cyjGR.LeK8UX.gwisUrmr17vDVYNqkKke8rUeEF13OXrxa_NyLFG25CvIsEY 5WmuMtVfkB0EMyfu3PKMFwZ7nVHWhi.Zgi6pp.uZGD2kn9SLuYTMpw7MgLk8 sAs5ecBONzGY_gwS8KRvYhfNbHdgapp2iI._c9Q2.yDWW7rTm.qGOoVpUW51 HWqwVsheyE7fcJtGN80BQP8xLuBqCOkBsdaof5zdo5Iw_XOvjhNpbEXIkmi0 pkyRC8s8SJvTxXhCVdqexLTb_TibXzb2cWCWMbmikxzmfTCCYp10X0o5jj6t SWA-- Received: from [212.235.4.36] by web30506.mail.mud.yahoo.com via HTTP; Wed, 09 Feb 2011 00:43:41 PST X-Mailer: YahooMailClassic/11.4.20 YahooMailWebService/0.8.108.291010 Date: Wed, 9 Feb 2011 00:43:41 -0800 (PST) From: sol myr Subject: [Lucene] custom Query, and Stop Words To: java-user@lucene.apache.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-975463120-1297241021=:37404" X-Virus-Checked: Checked by ClamAV on apache.org --0-975463120-1297241021=:37404 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi, I'm building my own BooleanQuery (rather than using Query Parser). That's b= ecause I need different defaults from my users:=20 If a user types:=A0 java program I need to run the query: +java* +program* (namely AND search, with Prefix s= o as to hit "programS", "programMER"). So naively I split the user's input into words, and build my query term-by-= term: =A0=A0 String[] words=3D userInput.split(" "); =A0=A0 BooleanQuery query=3Dnew BooleanQuery(); =A0=A0 for(String word: words) =A0=A0=A0=A0=A0=A0 query.add(new PrefixQuery(new Term("topic", word)), Occu= r.MUST); But since my index is built with StandardAnalyzer, I'm having trouble with = Stop Words. If the user types: program of java Then of course my query (+program* +of* +java+) returns zero results. Is there an easy solution? I'd like to keep using StandardAnalyzer (I don't want to index by stupid ke= ywords such as "of"). I would just like stop-words to be removed from my qu= ery (as QueryParser does). Is there some utility method for this? Direct access to the list of stop-wo= rds? Thanks=20 =0A=0A=0A =0A______________________________________________________________= ______________________=0ABored stiff? Loosen up... =0ADownload and play hun= dreds of games for free on Yahoo! Games.=0Ahttp://games.yahoo.com/games/fro= nt --0-975463120-1297241021=:37404--