You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@lucene.apache.org by riggerthegeek <si...@simonemms.com> on 2011/02/01 12:50:37 UTC
Solr Like Statement
Hi guys
I'm having some real problems getting Solr to behave. I'm running jQuery
autocomplete and want to get Solr to output the data (as there's 90,000+
records, MySQL will be slower).
If there was a record with the title "Birmingham City Centre", in MySQL, the
query I would write would be a simple........
SELECT * FROM `table` WHERE `title` LIKE 'Birmingham Ci%'
This would return every record that began "Birmingham Ci". I've run various
different queries in Solr, but none get the records I want.
If I do....
title:"birmingham ci*"
I get nothing returned.
If I do....
title:birmingham title:ci*
I get anything containing "Birmingham" and starting "ci".
Can someone tell me how to do the equivalent of a MySQL LIKE statement in
Solr/Lucene please?
Thanks
S
--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Like-Statement-tp2396733p2396733.html
Sent from the Lucene - General mailing list archive at Nabble.com.
Re: Solr Like Statement
Posted by Grant Ingersoll <gs...@apache.org>.
Just to follow up on this, you can use Solr's built in auto-suggest component for this: see http://wiki.apache.org/solr/Suggester Otherwise, have a look at the terms component if you want to roll your own at a lower level.
On Feb 1, 2011, at 3:50 AM, riggerthegeek wrote:
>
> Hi guys
>
>
> I'm having some real problems getting Solr to behave. I'm running jQuery
> autocomplete and want to get Solr to output the data (as there's 90,000+
> records, MySQL will be slower).
>
>
> If there was a record with the title "Birmingham City Centre", in MySQL, the
> query I would write would be a simple........
>
>
>
> SELECT * FROM `table` WHERE `title` LIKE 'Birmingham Ci%'
>
>
> This would return every record that began "Birmingham Ci". I've run various
> different queries in Solr, but none get the records I want.
>
>
> If I do....
>
> title:"birmingham ci*"
>
> I get nothing returned.
>
>
> If I do....
>
> title:birmingham title:ci*
>
>
> I get anything containing "Birmingham" and starting "ci".
>
>
> Can someone tell me how to do the equivalent of a MySQL LIKE statement in
> Solr/Lucene please?
>
>
> Thanks
>
>
> S
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Solr-Like-Statement-tp2396733p2396733.html
> Sent from the Lucene - General mailing list archive at Nabble.com.
--------------------------
Grant Ingersoll
http://www.lucidimagination.com/
Search the Lucene ecosystem docs using Solr/Lucene:
http://www.lucidimagination.com/search