Return-Path: Delivered-To: apmail-lucene-java-user-archive@www.apache.org Received: (qmail 21462 invoked from network); 8 Apr 2009 18:48:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Apr 2009 18:48:32 -0000 Received: (qmail 41502 invoked by uid 500); 8 Apr 2009 18:48:30 -0000 Delivered-To: apmail-lucene-java-user-archive@lucene.apache.org Received: (qmail 41409 invoked by uid 500); 8 Apr 2009 18:48:30 -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 41399 invoked by uid 99); 8 Apr 2009 18:48:30 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2009 18:48:30 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of MSchraeder@btsb.com designates 216.8.91.5 as permitted sender) Received: from [216.8.91.5] (HELO mail.btsb.com) (216.8.91.5) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Apr 2009 18:48:22 +0000 X-IronPort-AV: E=Sophos;i="4.39,345,1235973600"; d="scan'208,217";a="477921" Received: from unknown (HELO mail.btsb.com) ([10.1.1.2]) by mail.btsb.com with ESMTP; 08 Apr 2009 13:51:08 -0500 Received: from GWDOMAIN-MTA by mail.btsb.com with Novell_GroupWise; Wed, 08 Apr 2009 13:50:12 -0500 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.5 Date: Wed, 08 Apr 2009 13:50:00 -0500 From: "Matt Schraeder" To: Subject: Re: Suggestive Search Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=__PartC4EC5CC8.0__=" X-Virus-Checked: Checked by ClamAV on apache.org --=__PartC4EC5CC8.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Corerct me if I'm wrong, but I don't think n-grams is really what I'm looking for here. I'm not looking for a spellchecker or phrase checker style suggestive search, but only based on the exact phrases the user is currently typing. Since Lucene uses term-based searching, I'm not sure how to have it search on portions of a full phrase. Using a standard lucene search typing in "harr" will result in searching for "harr" as a term, which will not find "Harry Potter". Using ngrams it would find "Harry" as a term, but not at the beginning of an entire phrase. This would bring back "My Dog Harry" as a result, which isn't what I'm looking for. I just want phrases from fields beginning with "Harr" only. I could easily do this all with our database server by simply doing a query for "where searchqueries like 'harr%'" but we're trying to limit our hits to the database to keep speed up on the site. >>> karl.wettin@gmail.com 4/8/2009 12:49:45 PM >>> For this you probably want to use ngrams. Wether or not this is something that fits in your current index is hard to say. My guess is that you want to create a new index with one document per unique phrase. You might also want to try to load this index in an InstantiatedIndex, that could speed things up quite a bit if the corpus is not too large. If your suggestion text corpus is really large and you only want forward-only suggestions then you might want to consider a trie- pattern solution instead. These can be rather resource efficient, even when loaded to memory. If you have a lot of user load on your search eninge then it might be interesting to use old user queries as the base of your suggestions and perhaps boost a bit on trends, i.e. the more people search for something the more it get boosted in the suggestions list. karl 8 apr 2009 kl. 15.26 skrev Matt Schraeder: > I want to add a suggestive search similar to google's to autocomplete > search phrases as the user types. It doesn't have to be very > elaborate > and for the most part will just involve searching single fields. How > can I perform a search to be able to fill in autocomplete text? > > For instance, if I start typing "Harr" it should bring up "Harry > Potter" "Harry Houdini" and "Harry S. Truman" > > I have tried doing search queries for "Harr*" but it's still doing > term-based searching rather than searching a full field. To make a > field both searchable as the full field as well as tokenized, would I > have to duplicate the field and make one a keyword field? Is there a > more convenient way to do this? I have also considered making a second > index for suggestive search, which would only have the fields that I > want to enable suggestive search on, but this seems like it would be > unneccesary duplication of data as well, though it would probably make > suggestive search faster due to a smaller index. > > Ideally it would also be nice to be able to rank these terms based on > the number of times they have been searched for so that the results > are > tailored more to our users rather than simply just the score that > Lucene > chooses. --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org For additional commands, e-mail: java-user-help@lucene.apache.org --=__PartC4EC5CC8.0__=--