TermsComponent - AutoComplete - Multiple Term Suggestions Inclusive Search?

2010-06-23 Thread Saïd Radhouani
Hi,

I'm using the Terms Component to se up the autocomplete feature based on a 
String field. Here are the params I'm using:

terms=trueterms.fl=typeterms.lower=catterms.prefix=catterms.lower.incl=false

With the above params, I've been able to get suggestions for terms that start 
with the specified prefix. I'm wondering wether it's possible to:

- have inclusive search, i.e., by typing cat, we get category, 
subcategory, etc.?

- start suggestion from any word in the field. i.e., by typing cat, we get 
The best category...?

Thanks!

 -Saïd




Re: TermsComponent - AutoComplete - Multiple Term Suggestions Inclusive Search?

2010-06-23 Thread Chantal Ackermann
Hi Saïd,

I think your problem is the field's type: String. You have to use a
TextField and apply tokenizers that will find subcategory if you put
in cat. (Not sure which filter does that, though. I wouldn't think
that the PorterStemmer cuts off prefix syllables of that kind?)

If, however, you search on an analyzed version of the field it should
return hits as usual according to the analyzer chain, and you can thus
use the values of that field listed in the hits as suggestions.

Exmple:
input: potter
field type: solr.TextField (with porter stemmer)
finds: Harry Potter and Whatever
and also Potters and Plums


Cheers,
Chantal


On Wed, 2010-06-23 at 13:17 +0200, Saïd Radhouani wrote:
 Hi,
 
 I'm using the Terms Component to se up the autocomplete feature based on a 
 String field. Here are the params I'm using:
 
 terms=trueterms.fl=typeterms.lower=catterms.prefix=catterms.lower.incl=false
 
 With the above params, I've been able to get suggestions for terms that start 
 with the specified prefix. I'm wondering wether it's possible to:
 
 - have inclusive search, i.e., by typing cat, we get category, 
 subcategory, etc.?
 
 - start suggestion from any word in the field. i.e., by typing cat, we get 
 The best category...?
 
 Thanks!
 
  -Saïd
 
 





Re: TermsComponent - AutoComplete - Multiple Term Suggestions Inclusive Search?

2010-06-23 Thread Sophie M.

To build your autocompletion, you can use the NGramFilterFactory. If you type
cat It will match subcategory and the best category.

If you change your mind and you don't want anymore to match subcategory, you
can use the EdgeNGramFilterFactory.
-- 
View this message in context: 
http://lucene.472066.n3.nabble.com/TermsComponent-AutoComplete-Multiple-Term-Suggestions-Inclusive-Search-tp916530p916769.html
Sent from the Solr - User mailing list archive at Nabble.com.