You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Matt Schraeder <MS...@btsb.com> on 2009/04/08 15:26:48 UTC

Suggestive Search

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.

Re: Suggestive Search

Posted by Konstantyn Smirnov <in...@yahoo.com>.
I implemented the suggestions-feature for a couple of web-sites.

an example can be seen on 
http://www.genios.de/r_firmen/webcgi?START=016&SEITE=firmenk_d.ein&DBN=&WID=01852-8850939-00904_3
genios.de .

type smth in in the Firma and Person fields.

The Firma-index has 3++ mio records, Person ~ 1.6 mio

-----
Project Lead
http://www.poiradar.ru www.poiradar.ru 
http://www.poiradar.com.ua www.poiradar.com.ua 
http://www.poiradar.com www.poiradar.com 
http://www.poiradar.de www.poiradar.de 
-- 
View this message in context: http://www.nabble.com/Suggestive-Search-tp22950433p22972033.html
Sent from the Lucene - Java Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Suggestive Search

Posted by Karl Wettin <ka...@gmail.com>.
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