Return-Path: Delivered-To: apmail-jakarta-lucene-user-archive@apache.org Received: (qmail 1224 invoked from network); 27 Sep 2002 17:27:25 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 27 Sep 2002 17:27:25 -0000 Received: (qmail 5414 invoked by uid 97); 27 Sep 2002 17:27:45 -0000 Delivered-To: qmlist-jakarta-archive-lucene-user@jakarta.apache.org Received: (qmail 5186 invoked by uid 97); 27 Sep 2002 17:27:44 -0000 Mailing-List: contact lucene-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Lucene Users List" Reply-To: "Lucene Users List" Delivered-To: mailing list lucene-user@jakarta.apache.org Received: (qmail 5033 invoked by uid 98); 27 Sep 2002 17:27:41 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Date: Fri, 27 Sep 2002 10:31:16 -0700 (Pacific Daylight Time) From: "Joshua O'Madadhain" To: Lucene Users List Subject: Re: Query modifier ? In-Reply-To: <006a01c26631$64d58260$a73ca8c0@john> Message-ID: X-X-Sender: jmadden@smtp.ics.uci.edu MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-MailScanner: Found to be clean X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N On Fri, 27 Sep 2002, Ganael LAPLANCHE wrote: > Does anyone know how to implement a query modifier with Lucene ? I > would like to be able to use a dictionary to modify an invalid query > (just as Google does) and to suggest a new query to the user... This > isn't really a Lucene-related question, but if someone could help > me... The easiest way--or, at least, the method I used--is to do your own query parsing: (1) take the input from the user as a String (2) do whatever analysis or modifications on it that you like (e.g., breaking it down into words using a StringTokenizer and checking each word, by your favorite method, for misspellings) (3) optionally let user review your modifications (return to (1)) (4) create a Term from each word from the modified query (5) create a Query from your collection of Terms That's the basic idea. The details will depend on what kind of query you want to do, and whether you want to allow the user to specify Boolean modifiers, term boosts, etc. It may be possible to use the standard QueryParser to parse the query and then hack the Query that is returned, but I've never tried it. Good luck-- Joshua O'Madadhain jmadden@ics.uci.edu...Obscurium Per Obscurius...www.ics.uci.edu/~jmadden Joshua O'Madadhain: Information Scientist, Musician, Philosopher-At-Tall It's that moment of dawning comprehension that I live for--Bill Watterson My opinions are too rational and insightful to be those of any organization. -- To unsubscribe, e-mail: For additional commands, e-mail: