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 Salman Ansari <sa...@gmail.com> on 2015/10/12 22:24:47 UTC

AutoComplete Feature in Solr

Hi,

I have been trying to get the autocomplete feature in Solr working with no
luck up to now. First I read that "suggest component" is the recommended
way as in the below article (and this is the exact functionality I am
looking for, which is to autocomplete multiple words)
http://blog.trifork.com/2012/02/15/different-ways-to-make-auto-suggestions-with-solr/

Then I tried implementing suggest as described in the following articles in
this order
1) https://wiki.apache.org/solr/Suggester#SearchHandler_configuration
2) http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/  (I
implemented suggesting phrases)
3)
http://stackoverflow.com/questions/18132819/how-to-have-solr-autocomplete-on-whole-phrase-when-query-contains-multiple-terms

With no luck, after implementing each article when I run my query as
http://[MySolr]:8983/solr/entityStore114/suggest?spellcheck.q=Barack



I get
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
</lst>
</response>

 Although I have an entry for Barack Obama in my index. I am posting my
Solr configuration as well

<searchComponent name="suggest" class="solr.SpellCheckComponent">
 <lst name="spellchecker">
  <str name="name">suggest</str>
  <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
  <str
name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookup</str>
  <str name="field">entity_autocomplete</str>
<str name="buildOnCommit">true</str>
 </lst>
</searchComponent>

 <requestHandler name="/suggest"
class="org.apache.solr.handler.component.SearchHandler">
 <lst name="defaults">
  <str name="spellcheck">true</str>
  <str name="spellcheck.dictionary">suggest</str>
  <str name="spellcheck.count">10</str>
<str name="spellcheck.onlyMorePopular">true</str>
        <str name="spellcheck.collate">false</str>
 </lst>
 <arr name="components">
  <str>suggest</str>
 </arr>
</requestHandler>

It looks like a very simple job, but even after following so many articles,
I could not get it right. Any comment will be appreciated!

Regards,
Salman

Re: AutoComplete Feature in Solr

Posted by Alessandro Benedetti <be...@gmail.com>.
I would suggest you to read this in details :

*DocumentDictionaryFactory*
> A dictionary with terms, weights, and an optional payload taken from the
> index.
> This dictionary implementation takes the following parameters in addition
> to parameters described for the Suggester generally and for the lookup
> implementation:
>
>    - weightField: A field that is stored or a numeric DocValue field.
>    This field is optional.
>
>
>    - payloadField: The payloadField should be a field that is stored.
>    This field is optional.
>
>
>    - contextField: Field to be used for context filtering. Note that only
>    some lookup implementations support filtering.
>
> DocumentExpressionDictionaryFactory
> This dictionary implementation is the same as the
> DocumentDictionaryFactory but allows users to specify an arbitrary
> expression into the 'weightExpression' tag.
> This dictionary implementation takes the following parameters in addition
> to parameters described for the Suggester generally and for the lookup
> implementation:
>
>    - payloadField: The payloadField should be a field that is stored.
>    This field is optional.
>
>
>    - weightExpression: An arbitrary expression used for scoring the
>    suggestions. The fields used must be numeric fields. This field is required.
>
>
>    - contextField: Field to be used for context filtering. Note that only
>    some lookup implementations support filtering.
>
> *HighFrequencyDictionaryFactory*
> This dictionary implementation allows adding a threshold to prune out less
> frequent terms in cases where very common terms may overwhelm other terms.
> This dictionary implementation takes one parameter in addition to
> parameters described for the Suggester generally and for the lookup
> implementation:
>
>    - threshold: A value between zero and one representing the minimum
>    fraction of the total documents where a term should appear in order to be
>    added to the lookup dictionary.
>
>

Then play a little bit with the lookup implementation you want.
Can be useful to play with those 2 attributes of the config :

<searchComponent name="suggest" class="solr.SuggestComponent">
  <lst name="suggester">
    <str name="name">mySuggester</str>
...
    <str name="weightField">price</str>
...
  </lst>
  <lst name="suggester">
    <str name="name">altSuggester</str>
   ...
    <str name="weightExpression">((price * 2) + ln(popularity))</str>
    <str name="sortField">weight</str>
    <str name="sortField">price</str>
    ...
  </lst>
</searchComponent>

Hope this helps,
Cheers

On 14 October 2015 at 19:58, Salman Ansari <sa...@gmail.com> wrote:

> Actually what you mentioned Alessandro is something interesting for me. I
> am looking to boost the ranking of some suggestions based on some dynamic
> criteria (let's say how frequent they are used). Do I need to update the
> boost field each time I request the suggestion (to capture the frequency)?
> If you can direct me to an article that explains this with some scenarios
> of using boost that would be appreciated.
>
> Regards,
> Salman
>
>
> On Wed, Oct 14, 2015 at 11:49 AM, Alessandro Benedetti <
> benedetti.alex85@gmail.com> wrote:
>
> > using the suggester feature you can in some case rank the suggestions
> based
> > on an additional numeric field.
> > It's not your use case, you actually want to use a search handler with a
> > well defined schema that will allow you for example to query on an edge
> > ngram token filtered field, applying a geo distance boost function.
> >
> > This is what i would use and would work fine with your applied filter
> > queries as well ( reducing the space of Suggestions)
> >
> > Cheers
> >
> > On 14 October 2015 at 05:09, William Bell <bi...@gmail.com> wrote:
> >
> > > We want to use suggester but also want to show those results closest to
> > my
> > > lat,long... Kinda combine suggester and bq=geodist()
> > >
> > > On Mon, Oct 12, 2015 at 2:24 PM, Salman Ansari <
> salman.rahmat@gmail.com>
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > I have been trying to get the autocomplete feature in Solr working
> with
> > > no
> > > > luck up to now. First I read that "suggest component" is the
> > recommended
> > > > way as in the below article (and this is the exact functionality I am
> > > > looking for, which is to autocomplete multiple words)
> > > >
> > > >
> > >
> >
> http://blog.trifork.com/2012/02/15/different-ways-to-make-auto-suggestions-with-solr/
> > > >
> > > > Then I tried implementing suggest as described in the following
> > articles
> > > in
> > > > this order
> > > > 1)
> https://wiki.apache.org/solr/Suggester#SearchHandler_configuration
> > > > 2) http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/  (I
> > > > implemented suggesting phrases)
> > > > 3)
> > > >
> > > >
> > >
> >
> http://stackoverflow.com/questions/18132819/how-to-have-solr-autocomplete-on-whole-phrase-when-query-contains-multiple-terms
> > > >
> > > > With no luck, after implementing each article when I run my query as
> > > > http://[MySolr]:8983/solr/entityStore114/suggest?spellcheck.q=Barack
> > > >
> > > >
> > > >
> > > > I get
> > > > <response>
> > > > <lst name="responseHeader">
> > > > <int name="status">0</int>
> > > > <int name="QTime">0</int>
> > > > </lst>
> > > > </response>
> > > >
> > > >  Although I have an entry for Barack Obama in my index. I am posting
> my
> > > > Solr configuration as well
> > > >
> > > > <searchComponent name="suggest" class="solr.SpellCheckComponent">
> > > >  <lst name="spellchecker">
> > > >   <str name="name">suggest</str>
> > > >   <str
> > name="classname">org.apache.solr.spelling.suggest.Suggester</str>
> > > >   <str
> > > >
> name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookup</str>
> > > >   <str name="field">entity_autocomplete</str>
> > > > <str name="buildOnCommit">true</str>
> > > >  </lst>
> > > > </searchComponent>
> > > >
> > > >  <requestHandler name="/suggest"
> > > > class="org.apache.solr.handler.component.SearchHandler">
> > > >  <lst name="defaults">
> > > >   <str name="spellcheck">true</str>
> > > >   <str name="spellcheck.dictionary">suggest</str>
> > > >   <str name="spellcheck.count">10</str>
> > > > <str name="spellcheck.onlyMorePopular">true</str>
> > > >         <str name="spellcheck.collate">false</str>
> > > >  </lst>
> > > >  <arr name="components">
> > > >   <str>suggest</str>
> > > >  </arr>
> > > > </requestHandler>
> > > >
> > > > It looks like a very simple job, but even after following so many
> > > articles,
> > > > I could not get it right. Any comment will be appreciated!
> > > >
> > > > Regards,
> > > > Salman
> > > >
> > >
> > >
> > >
> > > --
> > > Bill Bell
> > > billnbell@gmail.com
> > > cell 720-256-8076
> > >
> >
> >
> >
> > --
> > --------------------------
> >
> > Benedetti Alessandro
> > Visiting card - http://about.me/alessandro_benedetti
> > Blog - http://alexbenedetti.blogspot.co.uk
> >
> > "Tyger, tyger burning bright
> > In the forests of the night,
> > What immortal hand or eye
> > Could frame thy fearful symmetry?"
> >
> > William Blake - Songs of Experience -1794 England
> >
>



-- 
--------------------------

Benedetti Alessandro
Visiting card - http://about.me/alessandro_benedetti
Blog - http://alexbenedetti.blogspot.co.uk

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England

Re: AutoComplete Feature in Solr

Posted by Salman Ansari <sa...@gmail.com>.
Actually what you mentioned Alessandro is something interesting for me. I
am looking to boost the ranking of some suggestions based on some dynamic
criteria (let's say how frequent they are used). Do I need to update the
boost field each time I request the suggestion (to capture the frequency)?
If you can direct me to an article that explains this with some scenarios
of using boost that would be appreciated.

Regards,
Salman


On Wed, Oct 14, 2015 at 11:49 AM, Alessandro Benedetti <
benedetti.alex85@gmail.com> wrote:

> using the suggester feature you can in some case rank the suggestions based
> on an additional numeric field.
> It's not your use case, you actually want to use a search handler with a
> well defined schema that will allow you for example to query on an edge
> ngram token filtered field, applying a geo distance boost function.
>
> This is what i would use and would work fine with your applied filter
> queries as well ( reducing the space of Suggestions)
>
> Cheers
>
> On 14 October 2015 at 05:09, William Bell <bi...@gmail.com> wrote:
>
> > We want to use suggester but also want to show those results closest to
> my
> > lat,long... Kinda combine suggester and bq=geodist()
> >
> > On Mon, Oct 12, 2015 at 2:24 PM, Salman Ansari <sa...@gmail.com>
> > wrote:
> >
> > > Hi,
> > >
> > > I have been trying to get the autocomplete feature in Solr working with
> > no
> > > luck up to now. First I read that "suggest component" is the
> recommended
> > > way as in the below article (and this is the exact functionality I am
> > > looking for, which is to autocomplete multiple words)
> > >
> > >
> >
> http://blog.trifork.com/2012/02/15/different-ways-to-make-auto-suggestions-with-solr/
> > >
> > > Then I tried implementing suggest as described in the following
> articles
> > in
> > > this order
> > > 1) https://wiki.apache.org/solr/Suggester#SearchHandler_configuration
> > > 2) http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/  (I
> > > implemented suggesting phrases)
> > > 3)
> > >
> > >
> >
> http://stackoverflow.com/questions/18132819/how-to-have-solr-autocomplete-on-whole-phrase-when-query-contains-multiple-terms
> > >
> > > With no luck, after implementing each article when I run my query as
> > > http://[MySolr]:8983/solr/entityStore114/suggest?spellcheck.q=Barack
> > >
> > >
> > >
> > > I get
> > > <response>
> > > <lst name="responseHeader">
> > > <int name="status">0</int>
> > > <int name="QTime">0</int>
> > > </lst>
> > > </response>
> > >
> > >  Although I have an entry for Barack Obama in my index. I am posting my
> > > Solr configuration as well
> > >
> > > <searchComponent name="suggest" class="solr.SpellCheckComponent">
> > >  <lst name="spellchecker">
> > >   <str name="name">suggest</str>
> > >   <str
> name="classname">org.apache.solr.spelling.suggest.Suggester</str>
> > >   <str
> > > name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookup</str>
> > >   <str name="field">entity_autocomplete</str>
> > > <str name="buildOnCommit">true</str>
> > >  </lst>
> > > </searchComponent>
> > >
> > >  <requestHandler name="/suggest"
> > > class="org.apache.solr.handler.component.SearchHandler">
> > >  <lst name="defaults">
> > >   <str name="spellcheck">true</str>
> > >   <str name="spellcheck.dictionary">suggest</str>
> > >   <str name="spellcheck.count">10</str>
> > > <str name="spellcheck.onlyMorePopular">true</str>
> > >         <str name="spellcheck.collate">false</str>
> > >  </lst>
> > >  <arr name="components">
> > >   <str>suggest</str>
> > >  </arr>
> > > </requestHandler>
> > >
> > > It looks like a very simple job, but even after following so many
> > articles,
> > > I could not get it right. Any comment will be appreciated!
> > >
> > > Regards,
> > > Salman
> > >
> >
> >
> >
> > --
> > Bill Bell
> > billnbell@gmail.com
> > cell 720-256-8076
> >
>
>
>
> --
> --------------------------
>
> Benedetti Alessandro
> Visiting card - http://about.me/alessandro_benedetti
> Blog - http://alexbenedetti.blogspot.co.uk
>
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
>
> William Blake - Songs of Experience -1794 England
>

Re: AutoComplete Feature in Solr

Posted by Alessandro Benedetti <be...@gmail.com>.
using the suggester feature you can in some case rank the suggestions based
on an additional numeric field.
It's not your use case, you actually want to use a search handler with a
well defined schema that will allow you for example to query on an edge
ngram token filtered field, applying a geo distance boost function.

This is what i would use and would work fine with your applied filter
queries as well ( reducing the space of Suggestions)

Cheers

On 14 October 2015 at 05:09, William Bell <bi...@gmail.com> wrote:

> We want to use suggester but also want to show those results closest to my
> lat,long... Kinda combine suggester and bq=geodist()
>
> On Mon, Oct 12, 2015 at 2:24 PM, Salman Ansari <sa...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I have been trying to get the autocomplete feature in Solr working with
> no
> > luck up to now. First I read that "suggest component" is the recommended
> > way as in the below article (and this is the exact functionality I am
> > looking for, which is to autocomplete multiple words)
> >
> >
> http://blog.trifork.com/2012/02/15/different-ways-to-make-auto-suggestions-with-solr/
> >
> > Then I tried implementing suggest as described in the following articles
> in
> > this order
> > 1) https://wiki.apache.org/solr/Suggester#SearchHandler_configuration
> > 2) http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/  (I
> > implemented suggesting phrases)
> > 3)
> >
> >
> http://stackoverflow.com/questions/18132819/how-to-have-solr-autocomplete-on-whole-phrase-when-query-contains-multiple-terms
> >
> > With no luck, after implementing each article when I run my query as
> > http://[MySolr]:8983/solr/entityStore114/suggest?spellcheck.q=Barack
> >
> >
> >
> > I get
> > <response>
> > <lst name="responseHeader">
> > <int name="status">0</int>
> > <int name="QTime">0</int>
> > </lst>
> > </response>
> >
> >  Although I have an entry for Barack Obama in my index. I am posting my
> > Solr configuration as well
> >
> > <searchComponent name="suggest" class="solr.SpellCheckComponent">
> >  <lst name="spellchecker">
> >   <str name="name">suggest</str>
> >   <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
> >   <str
> > name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookup</str>
> >   <str name="field">entity_autocomplete</str>
> > <str name="buildOnCommit">true</str>
> >  </lst>
> > </searchComponent>
> >
> >  <requestHandler name="/suggest"
> > class="org.apache.solr.handler.component.SearchHandler">
> >  <lst name="defaults">
> >   <str name="spellcheck">true</str>
> >   <str name="spellcheck.dictionary">suggest</str>
> >   <str name="spellcheck.count">10</str>
> > <str name="spellcheck.onlyMorePopular">true</str>
> >         <str name="spellcheck.collate">false</str>
> >  </lst>
> >  <arr name="components">
> >   <str>suggest</str>
> >  </arr>
> > </requestHandler>
> >
> > It looks like a very simple job, but even after following so many
> articles,
> > I could not get it right. Any comment will be appreciated!
> >
> > Regards,
> > Salman
> >
>
>
>
> --
> Bill Bell
> billnbell@gmail.com
> cell 720-256-8076
>



-- 
--------------------------

Benedetti Alessandro
Visiting card - http://about.me/alessandro_benedetti
Blog - http://alexbenedetti.blogspot.co.uk

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England

Re: AutoComplete Feature in Solr

Posted by William Bell <bi...@gmail.com>.
We want to use suggester but also want to show those results closest to my
lat,long... Kinda combine suggester and bq=geodist()

On Mon, Oct 12, 2015 at 2:24 PM, Salman Ansari <sa...@gmail.com>
wrote:

> Hi,
>
> I have been trying to get the autocomplete feature in Solr working with no
> luck up to now. First I read that "suggest component" is the recommended
> way as in the below article (and this is the exact functionality I am
> looking for, which is to autocomplete multiple words)
>
> http://blog.trifork.com/2012/02/15/different-ways-to-make-auto-suggestions-with-solr/
>
> Then I tried implementing suggest as described in the following articles in
> this order
> 1) https://wiki.apache.org/solr/Suggester#SearchHandler_configuration
> 2) http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/  (I
> implemented suggesting phrases)
> 3)
>
> http://stackoverflow.com/questions/18132819/how-to-have-solr-autocomplete-on-whole-phrase-when-query-contains-multiple-terms
>
> With no luck, after implementing each article when I run my query as
> http://[MySolr]:8983/solr/entityStore114/suggest?spellcheck.q=Barack
>
>
>
> I get
> <response>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">0</int>
> </lst>
> </response>
>
>  Although I have an entry for Barack Obama in my index. I am posting my
> Solr configuration as well
>
> <searchComponent name="suggest" class="solr.SpellCheckComponent">
>  <lst name="spellchecker">
>   <str name="name">suggest</str>
>   <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
>   <str
> name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookup</str>
>   <str name="field">entity_autocomplete</str>
> <str name="buildOnCommit">true</str>
>  </lst>
> </searchComponent>
>
>  <requestHandler name="/suggest"
> class="org.apache.solr.handler.component.SearchHandler">
>  <lst name="defaults">
>   <str name="spellcheck">true</str>
>   <str name="spellcheck.dictionary">suggest</str>
>   <str name="spellcheck.count">10</str>
> <str name="spellcheck.onlyMorePopular">true</str>
>         <str name="spellcheck.collate">false</str>
>  </lst>
>  <arr name="components">
>   <str>suggest</str>
>  </arr>
> </requestHandler>
>
> It looks like a very simple job, but even after following so many articles,
> I could not get it right. Any comment will be appreciated!
>
> Regards,
> Salman
>



-- 
Bill Bell
billnbell@gmail.com
cell 720-256-8076

Re: AutoComplete Feature in Solr

Posted by Erick Erickson <er...@gmail.com>.
Some of the links you're looking at are quite old, and a lot has
changed, assuming you're on a recent Solr version. It's usually best
to look at the Solr reference guide, see:
https://cwiki.apache.org/confluence/display/solr/Suggester

This might also help:
http://lucidworks.com/blog/2015/03/04/solr-suggester/

Best,
Erick


On Mon, Oct 12, 2015 at 1:24 PM, Salman Ansari <sa...@gmail.com> wrote:
> Hi,
>
> I have been trying to get the autocomplete feature in Solr working with no
> luck up to now. First I read that "suggest component" is the recommended
> way as in the below article (and this is the exact functionality I am
> looking for, which is to autocomplete multiple words)
> http://blog.trifork.com/2012/02/15/different-ways-to-make-auto-suggestions-with-solr/
>
> Then I tried implementing suggest as described in the following articles in
> this order
> 1) https://wiki.apache.org/solr/Suggester#SearchHandler_configuration
> 2) http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/  (I
> implemented suggesting phrases)
> 3)
> http://stackoverflow.com/questions/18132819/how-to-have-solr-autocomplete-on-whole-phrase-when-query-contains-multiple-terms
>
> With no luck, after implementing each article when I run my query as
> http://[MySolr]:8983/solr/entityStore114/suggest?spellcheck.q=Barack
>
>
>
> I get
> <response>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">0</int>
> </lst>
> </response>
>
>  Although I have an entry for Barack Obama in my index. I am posting my
> Solr configuration as well
>
> <searchComponent name="suggest" class="solr.SpellCheckComponent">
>  <lst name="spellchecker">
>   <str name="name">suggest</str>
>   <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
>   <str
> name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookup</str>
>   <str name="field">entity_autocomplete</str>
> <str name="buildOnCommit">true</str>
>  </lst>
> </searchComponent>
>
>  <requestHandler name="/suggest"
> class="org.apache.solr.handler.component.SearchHandler">
>  <lst name="defaults">
>   <str name="spellcheck">true</str>
>   <str name="spellcheck.dictionary">suggest</str>
>   <str name="spellcheck.count">10</str>
> <str name="spellcheck.onlyMorePopular">true</str>
>         <str name="spellcheck.collate">false</str>
>  </lst>
>  <arr name="components">
>   <str>suggest</str>
>  </arr>
> </requestHandler>
>
> It looks like a very simple job, but even after following so many articles,
> I could not get it right. Any comment will be appreciated!
>
> Regards,
> Salman

Re: AutoComplete Feature in Solr

Posted by Salman Ansari <sa...@gmail.com>.
Thanks guys, I was able to make it work using your articles. The key point
was mentioned in one of the articles which was that suggestion component is
preconfigured in techproducts sample. I started my work from there and
tweaked it to suit my needs. Thanks a lot!

One thing still remaining, I don't find the support for "suggest" is
Solr.NET. What I found is that we should use Spell check but that is not
the recommended option as per the articles. Spell Check component in
Solr.NET will use /spell component while I have configured suggestions
using /suggest component. It is easy to handle it myself as well but I was
just wondering if Solr.NET supports suggest component somehow.

Regards,
Salman

On Tue, Oct 13, 2015 at 2:39 PM, Alessandro Benedetti <
benedetti.alex85@gmail.com> wrote:

> As Erick suggested you are reading a really old way to provide the
> autocomplete feature !
> Please take a read to the docs Erick linked and to my blog as well.
> It will definitely give you more insight about the Autocomplete world !
>
> Cheers
>
> [1] http://alexbenedetti.blogspot.co.uk/2015/07/solr-you-complete-me.html
>
> On 12 October 2015 at 21:24, Salman Ansari <sa...@gmail.com>
> wrote:
>
> > Hi,
> >
> > I have been trying to get the autocomplete feature in Solr working with
> no
> > luck up to now. First I read that "suggest component" is the recommended
> > way as in the below article (and this is the exact functionality I am
> > looking for, which is to autocomplete multiple words)
> >
> >
> http://blog.trifork.com/2012/02/15/different-ways-to-make-auto-suggestions-with-solr/
> >
> > Then I tried implementing suggest as described in the following articles
> in
> > this order
> > 1) https://wiki.apache.org/solr/Suggester#SearchHandler_configuration
> > 2) http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/  (I
> > implemented suggesting phrases)
> > 3)
> >
> >
> http://stackoverflow.com/questions/18132819/how-to-have-solr-autocomplete-on-whole-phrase-when-query-contains-multiple-terms
> >
> > With no luck, after implementing each article when I run my query as
> > http://[MySolr]:8983/solr/entityStore114/suggest?spellcheck.q=Barack
> >
> >
> >
> > I get
> > <response>
> > <lst name="responseHeader">
> > <int name="status">0</int>
> > <int name="QTime">0</int>
> > </lst>
> > </response>
> >
> >  Although I have an entry for Barack Obama in my index. I am posting my
> > Solr configuration as well
> >
> > <searchComponent name="suggest" class="solr.SpellCheckComponent">
> >  <lst name="spellchecker">
> >   <str name="name">suggest</str>
> >   <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
> >   <str
> > name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookup</str>
> >   <str name="field">entity_autocomplete</str>
> > <str name="buildOnCommit">true</str>
> >  </lst>
> > </searchComponent>
> >
> >  <requestHandler name="/suggest"
> > class="org.apache.solr.handler.component.SearchHandler">
> >  <lst name="defaults">
> >   <str name="spellcheck">true</str>
> >   <str name="spellcheck.dictionary">suggest</str>
> >   <str name="spellcheck.count">10</str>
> > <str name="spellcheck.onlyMorePopular">true</str>
> >         <str name="spellcheck.collate">false</str>
> >  </lst>
> >  <arr name="components">
> >   <str>suggest</str>
> >  </arr>
> > </requestHandler>
> >
> > It looks like a very simple job, but even after following so many
> articles,
> > I could not get it right. Any comment will be appreciated!
> >
> > Regards,
> > Salman
> >
>
>
>
> --
> --------------------------
>
> Benedetti Alessandro
> Visiting card - http://about.me/alessandro_benedetti
> Blog - http://alexbenedetti.blogspot.co.uk
>
> "Tyger, tyger burning bright
> In the forests of the night,
> What immortal hand or eye
> Could frame thy fearful symmetry?"
>
> William Blake - Songs of Experience -1794 England
>

Re: AutoComplete Feature in Solr

Posted by Alessandro Benedetti <be...@gmail.com>.
As Erick suggested you are reading a really old way to provide the
autocomplete feature !
Please take a read to the docs Erick linked and to my blog as well.
It will definitely give you more insight about the Autocomplete world !

Cheers

[1] http://alexbenedetti.blogspot.co.uk/2015/07/solr-you-complete-me.html

On 12 October 2015 at 21:24, Salman Ansari <sa...@gmail.com> wrote:

> Hi,
>
> I have been trying to get the autocomplete feature in Solr working with no
> luck up to now. First I read that "suggest component" is the recommended
> way as in the below article (and this is the exact functionality I am
> looking for, which is to autocomplete multiple words)
>
> http://blog.trifork.com/2012/02/15/different-ways-to-make-auto-suggestions-with-solr/
>
> Then I tried implementing suggest as described in the following articles in
> this order
> 1) https://wiki.apache.org/solr/Suggester#SearchHandler_configuration
> 2) http://solr.pl/en/2010/11/15/solr-and-autocomplete-part-2/  (I
> implemented suggesting phrases)
> 3)
>
> http://stackoverflow.com/questions/18132819/how-to-have-solr-autocomplete-on-whole-phrase-when-query-contains-multiple-terms
>
> With no luck, after implementing each article when I run my query as
> http://[MySolr]:8983/solr/entityStore114/suggest?spellcheck.q=Barack
>
>
>
> I get
> <response>
> <lst name="responseHeader">
> <int name="status">0</int>
> <int name="QTime">0</int>
> </lst>
> </response>
>
>  Although I have an entry for Barack Obama in my index. I am posting my
> Solr configuration as well
>
> <searchComponent name="suggest" class="solr.SpellCheckComponent">
>  <lst name="spellchecker">
>   <str name="name">suggest</str>
>   <str name="classname">org.apache.solr.spelling.suggest.Suggester</str>
>   <str
> name="lookupImpl">org.apache.solr.spelling.suggest.fst.FSTLookup</str>
>   <str name="field">entity_autocomplete</str>
> <str name="buildOnCommit">true</str>
>  </lst>
> </searchComponent>
>
>  <requestHandler name="/suggest"
> class="org.apache.solr.handler.component.SearchHandler">
>  <lst name="defaults">
>   <str name="spellcheck">true</str>
>   <str name="spellcheck.dictionary">suggest</str>
>   <str name="spellcheck.count">10</str>
> <str name="spellcheck.onlyMorePopular">true</str>
>         <str name="spellcheck.collate">false</str>
>  </lst>
>  <arr name="components">
>   <str>suggest</str>
>  </arr>
> </requestHandler>
>
> It looks like a very simple job, but even after following so many articles,
> I could not get it right. Any comment will be appreciated!
>
> Regards,
> Salman
>



-- 
--------------------------

Benedetti Alessandro
Visiting card - http://about.me/alessandro_benedetti
Blog - http://alexbenedetti.blogspot.co.uk

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England