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=true&terms.fl=type&terms.lower=cat&terms.prefix=cat&terms.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
> 
> 



Reply via email to