You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Peter Kirk <pk...@alpha-solutions.dk> on 2012/09/06 09:48:01 UTC
terms component search
Hi
I am trying to implement some "auto suggest" functionality, and am currently looking at the terms component (Solr 3.6).
For example, I can form a query like this:
http://solrhost/solr/mycore/terms?terms.fl=title_s&terms.sort=index&terms.limit=5&terms.prefix=Hotel+C
which searches in the "title_s" field for strings starting "Hotel C". Results could be
Hotel Chicago, 2
Hotel California, 8
Hotel Cool, 4
Is it possible to get more info in the results from this component - like return data from other fields?
For example, along with the results from the "title_s" field, the corresponding data from the "telephone" field.
Or, maybe I simply should execute a normal wildcard search.
Thanks,
Peter
Re: terms component search
Posted by Tanguy Moal <ta...@gmail.com>.
Hi Peter,
Yes if you want to do complex things in suggest mode, you'd better rely on
the SearchComponent...
For example, this blog post is a good read
http://www.cominvent.com/2012/01/25/super-flexible-autocomplete-with-solr/ ,
if you have complex requirements on the searched fields.
(Although your requirements seem to be more related to the results
extraction than query building)
Kind regards,
--
Tanguy
2012/9/6 Peter Kirk <pk...@alpha-solutions.dk>
> Hi
>
> I am trying to implement some "auto suggest" functionality, and am
> currently looking at the terms component (Solr 3.6).
>
> For example, I can form a query like this:
>
>
> http://solrhost/solr/mycore/terms?terms.fl=title_s&terms.sort=index&terms.limit=5&terms.prefix=Hotel+C
>
> which searches in the "title_s" field for strings starting "Hotel C".
> Results could be
> Hotel Chicago, 2
> Hotel California, 8
> Hotel Cool, 4
>
> Is it possible to get more info in the results from this component - like
> return data from other fields?
>
> For example, along with the results from the "title_s" field, the
> corresponding data from the "telephone" field.
>
> Or, maybe I simply should execute a normal wildcard search.
>
> Thanks,
> Peter
>
>