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 PeterKerk <ve...@hotmail.com> on 2010/11/02 18:56:53 UTC

Solr like for autocomplete field?

I have a city field. Now when a user starts typing in a city textbox I want
to return found matches (like Google).

So for example, user types "new", and I will return "new york", "new
hampshire" etc.

my schema.xml

<field name="city" type="string" indexed="true" stored="true"/>

my current url:

http://localhost:8983/solr/db/select/?indent=on&facet=true&q=*:*&start=0&rows=25&fl=id&facet.field=city&fq=city:new


Basically 2 questions here:
1. is the url Im using the best practice when implementing autocomplete?
What I wanted to do, is use the facets for found matches.
2. How can I match PART of the cityname just like the SQL LIKE command,
cityname LIKE '%<userinput>'


Thanks!
-- 
View this message in context: http://lucene.472066.n3.nabble.com/Solr-like-for-autocomplete-field-tp1829480p1829480.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr like for autocomplete field?

Posted by tr...@sachsendv.de.
Have a look at ajax-solr
http://evolvingweb.github.com/ajax-solr/

in the tutorial is an example of an autocompletion widget.

tob



From:
Amit Nithian <an...@gmail.com>
To:
solr-user@lucene.apache.org
Date:
03.11.2010 07:36
Subject:
Re: Solr like for autocomplete field?



I implemented the edge ngrams solution and it's an awesome one
compared to any other that I could think of because I can index more
than just text (other metadata) that can be used to *rank* the
autocomplete results eventually getting to rank by the probability of
selection which is, after all, what you want to try and maximize with
such systems.


On Tue, Nov 2, 2010 at 6:30 PM, Lance Norskog <go...@gmail.com> wrote:
> And the SpellingComponent.
>
> There's nothing to help you with phrases.
>
> On Tue, Nov 2, 2010 at 11:21 AM, Erick Erickson 
<er...@gmail.com> wrote:
>> Also, you might want to consider TermsComponent, see:
>>
>> http://wiki.apache.org/solr/TermsComponent
>>
>> Also, note that there's an autosuggestcomponent, that's recently been
>> committed.
>>
>> Best
>> Erick
>>
>> On Tue, Nov 2, 2010 at 1:56 PM, PeterKerk <ve...@hotmail.com> 
wrote:
>>
>>>
>>> I have a city field. Now when a user starts typing in a city textbox I 
want
>>> to return found matches (like Google).
>>>
>>> So for example, user types "new", and I will return "new york", "new
>>> hampshire" etc.
>>>
>>> my schema.xml
>>>
>>> <field name="city" type="string" indexed="true" stored="true"/>
>>>
>>> my current url:
>>>
>>>
>>> 
http://localhost:8983/solr/db/select/?indent=on&facet=true&q=*:*&start=0&rows=25&fl=id&facet.field=city&fq=city:new

>>>
>>>
>>> Basically 2 questions here:
>>> 1. is the url Im using the best practice when implementing 
autocomplete?
>>> What I wanted to do, is use the facets for found matches.
>>> 2. How can I match PART of the cityname just like the SQL LIKE 
command,
>>> cityname LIKE '%<userinput>'
>>>
>>>
>>> Thanks!
>>> --
>>> View this message in context:
>>> 
http://lucene.472066.n3.nabble.com/Solr-like-for-autocomplete-field-tp1829480p1829480.html

>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>
>
>
>
> --
> Lance Norskog
> goksron@gmail.com
>




_________________________________________________________________

Sachsen DV Betriebs- und Servicegesellschaft mbH
Täubchenweg 26
04317 Leipzig
Amtsgericht Leipzig, HRB 18545

Geschäftsführer: Herbert Roller Brandão, Dr. Jean-Michael Pfitzner

Aufsichtsratsvorsitzender: Sven Petersen

Re: Solr like for autocomplete field?

Posted by Amit Nithian <an...@gmail.com>.
I implemented the edge ngrams solution and it's an awesome one
compared to any other that I could think of because I can index more
than just text (other metadata) that can be used to *rank* the
autocomplete results eventually getting to rank by the probability of
selection which is, after all, what you want to try and maximize with
such systems.


On Tue, Nov 2, 2010 at 6:30 PM, Lance Norskog <go...@gmail.com> wrote:
> And the SpellingComponent.
>
> There's nothing to help you with phrases.
>
> On Tue, Nov 2, 2010 at 11:21 AM, Erick Erickson <er...@gmail.com> wrote:
>> Also, you might want to consider TermsComponent, see:
>>
>> http://wiki.apache.org/solr/TermsComponent
>>
>> Also, note that there's an autosuggestcomponent, that's recently been
>> committed.
>>
>> Best
>> Erick
>>
>> On Tue, Nov 2, 2010 at 1:56 PM, PeterKerk <ve...@hotmail.com> wrote:
>>
>>>
>>> I have a city field. Now when a user starts typing in a city textbox I want
>>> to return found matches (like Google).
>>>
>>> So for example, user types "new", and I will return "new york", "new
>>> hampshire" etc.
>>>
>>> my schema.xml
>>>
>>> <field name="city" type="string" indexed="true" stored="true"/>
>>>
>>> my current url:
>>>
>>>
>>> http://localhost:8983/solr/db/select/?indent=on&facet=true&q=*:*&start=0&rows=25&fl=id&facet.field=city&fq=city:new
>>>
>>>
>>> Basically 2 questions here:
>>> 1. is the url Im using the best practice when implementing autocomplete?
>>> What I wanted to do, is use the facets for found matches.
>>> 2. How can I match PART of the cityname just like the SQL LIKE command,
>>> cityname LIKE '%<userinput>'
>>>
>>>
>>> Thanks!
>>> --
>>> View this message in context:
>>> http://lucene.472066.n3.nabble.com/Solr-like-for-autocomplete-field-tp1829480p1829480.html
>>> Sent from the Solr - User mailing list archive at Nabble.com.
>>>
>>
>
>
>
> --
> Lance Norskog
> goksron@gmail.com
>

Re: Solr like for autocomplete field?

Posted by Lance Norskog <go...@gmail.com>.
And the SpellingComponent.

There's nothing to help you with phrases.

On Tue, Nov 2, 2010 at 11:21 AM, Erick Erickson <er...@gmail.com> wrote:
> Also, you might want to consider TermsComponent, see:
>
> http://wiki.apache.org/solr/TermsComponent
>
> Also, note that there's an autosuggestcomponent, that's recently been
> committed.
>
> Best
> Erick
>
> On Tue, Nov 2, 2010 at 1:56 PM, PeterKerk <ve...@hotmail.com> wrote:
>
>>
>> I have a city field. Now when a user starts typing in a city textbox I want
>> to return found matches (like Google).
>>
>> So for example, user types "new", and I will return "new york", "new
>> hampshire" etc.
>>
>> my schema.xml
>>
>> <field name="city" type="string" indexed="true" stored="true"/>
>>
>> my current url:
>>
>>
>> http://localhost:8983/solr/db/select/?indent=on&facet=true&q=*:*&start=0&rows=25&fl=id&facet.field=city&fq=city:new
>>
>>
>> Basically 2 questions here:
>> 1. is the url Im using the best practice when implementing autocomplete?
>> What I wanted to do, is use the facets for found matches.
>> 2. How can I match PART of the cityname just like the SQL LIKE command,
>> cityname LIKE '%<userinput>'
>>
>>
>> Thanks!
>> --
>> View this message in context:
>> http://lucene.472066.n3.nabble.com/Solr-like-for-autocomplete-field-tp1829480p1829480.html
>> Sent from the Solr - User mailing list archive at Nabble.com.
>>
>



-- 
Lance Norskog
goksron@gmail.com

Re: Solr like for autocomplete field?

Posted by Erick Erickson <er...@gmail.com>.
Also, you might want to consider TermsComponent, see:

http://wiki.apache.org/solr/TermsComponent

Also, note that there's an autosuggestcomponent, that's recently been
committed.

Best
Erick

On Tue, Nov 2, 2010 at 1:56 PM, PeterKerk <ve...@hotmail.com> wrote:

>
> I have a city field. Now when a user starts typing in a city textbox I want
> to return found matches (like Google).
>
> So for example, user types "new", and I will return "new york", "new
> hampshire" etc.
>
> my schema.xml
>
> <field name="city" type="string" indexed="true" stored="true"/>
>
> my current url:
>
>
> http://localhost:8983/solr/db/select/?indent=on&facet=true&q=*:*&start=0&rows=25&fl=id&facet.field=city&fq=city:new
>
>
> Basically 2 questions here:
> 1. is the url Im using the best practice when implementing autocomplete?
> What I wanted to do, is use the facets for found matches.
> 2. How can I match PART of the cityname just like the SQL LIKE command,
> cityname LIKE '%<userinput>'
>
>
> Thanks!
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-like-for-autocomplete-field-tp1829480p1829480.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>

Re: Solr like for autocomplete field?

Posted by Matthew Hall <mh...@informatics.jax.org>.
We used the filters talked about at Lucid Imagination for our site, it 
seems to work pretty well:

http://www.lucidimagination.com/blog/2009/09/08/auto-suggest-from-popular-queries-using-edgengrams/

Your mileage might vary, but its a pretty good place to start.

Matt

On 11/2/2010 1:56 PM, PeterKerk wrote:
> I have a city field. Now when a user starts typing in a city textbox I want
> to return found matches (like Google).
>
> So for example, user types "new", and I will return "new york", "new
> hampshire" etc.
>
> my schema.xml
>
> <field name="city" type="string" indexed="true" stored="true"/>
>
> my current url:
>
> http://localhost:8983/solr/db/select/?indent=on&facet=true&q=*:*&start=0&rows=25&fl=id&facet.field=city&fq=city:new
>
>
> Basically 2 questions here:
> 1. is the url Im using the best practice when implementing autocomplete?
> What I wanted to do, is use the facets for found matches.
> 2. How can I match PART of the cityname just like the SQL LIKE command,
> cityname LIKE '%<userinput>'
>
>
> Thanks!