autoSuggest

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

autoSuggest

sunnyShiny06
Hi,

I would like to know how work /autoSuggest.

I do have result when I hit :

/autoSuggest?terms=true&indent=true&terms.fl=title&terms.rows=5&terms.lower=simp&omitHeader=true

I've:
<response>
<lst name="terms">
<lst name="title">
<int name="simp">74</int>
<int name="simpa">129</int>
<int name="simpal">2</int>
<int name="simpalma">2</int>
<int name="simpan">1</int>
</lst>
</lst>
</response>

How can I ask it to suggest first expression which are more frequent in the database ?
How can I look for even for two words, ie: I look for "bara" ... make it suggesting "barack obama" ???

thanks a lot,

Reply | Threaded
Open this post in threaded view
|

Re: autoSuggest

Matt Weber-2
I am not sure you can return the results in order of frequency, you  
will have to sort the results yourself.  Also, for autoSuggest you  
will want to add the terms.prefix=input term and  
terms.lower.incl=false so your example will be:

/autoSuggest?
terms
=
true
&indent
=
true
&terms
.fl
=
title
&terms
.rows
=
5
&terms
.lower=simp&terms.lower.incl=false&terms.prefix=simp&omitHeader=true

To get results for more multiple words such as "barack obama", you  
need to set the terms.fl parameter to an untokenized, un-processed  
field just as you would with a facet.  So in your schema.xml, add a  
new string field, then use a copyfield to copy the value of title into  
the new field and set terms.fl to the new field you just created after  
reindexing.

Thanks,

Matt Weber

On May 4, 2009, at 6:46 AM, sunnyfr wrote:

>
> Hi,
>
> I would like to know how work /autoSuggest.
>
> I do have result when I hit :
> /autoSuggest?
> terms
> =
> true
> &indent
> =true&terms.fl=title&terms.rows=5&terms.lower=simp&omitHeader=true
>
> I've:
> <response>
> <lst name="terms">
> <lst name="title">
> <int name="simp">74</int>
> <int name="simpa">129</int>
> <int name="simpal">2</int>
> <int name="simpalma">2</int>
> <int name="simpan">1</int>
> </lst>
> </lst>
> </response>
>
> How can I ask it to suggest first expression which are more frequent  
> in the
> database ?
> How can I look for even for two words, ie: I look for "bara" ...  
> make it
> suggesting "barack obama" ???
>
> thanks a lot,
>
>
> --
> View this message in context: http://www.nabble.com/autoSuggest-tp23367848p23367848.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Thanks,

Matt Weber
eSr Technologies
http://www.esr-technologies.com