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 "Nemani, Raj" <Ra...@turner.com> on 2010/08/20 16:14:07 UTC

Wild card based filter queries

Hello all,

 

I was wondering If you all can help me with the following.

 

Is it possible to filter search queries using wild cards.  Here is what
I am thinking..

 

>From Solr admin's full search interface I can enter the following into
"Filter Query" text box to filter the results

 

Ex: queue:"myqueue" 

Will return all the documents in the index where the field "queue" has
the value "myqueue"

 

Can I take the same approach but using wild card filter term such as the
following.  

 

Ex:queue: "%my%" 

 

I am guessing the wild card syntax above to convey the point.  Is this
possible and if it is what is the correct syntax?  In addition, does it
work on all fields including fields such as the unique key field etc?

 

Thanks in advance for your help

Raj

 


Re: Wild card based filter queries

Posted by Erick Erickson <er...@gmail.com>.
Well, you can't really do a *blah* without arranging your index
appropriately
(n-grams come to mind). Queries of this form are really, really expensive.

You can do leading and trailing wildcards (i.e. *blah or blah*), but even
leading wildcards require some changes to your schema...

The short answer is that you can do these things, but they won't work out
of the box, you have to arrange for them to occur.

HTH
Erick

On Fri, Aug 20, 2010 at 7:14 AM, Nemani, Raj <Ra...@turner.com> wrote:

> Hello all,
>
>
>
> I was wondering If you all can help me with the following.
>
>
>
> Is it possible to filter search queries using wild cards.  Here is what
> I am thinking..
>
>
>
> From Solr admin's full search interface I can enter the following into
> "Filter Query" text box to filter the results
>
>
>
> Ex: queue:"myqueue"
>
> Will return all the documents in the index where the field "queue" has
> the value "myqueue"
>
>
>
> Can I take the same approach but using wild card filter term such as the
> following.
>
>
>
> Ex:queue: "%my%"
>
>
>
> I am guessing the wild card syntax above to convey the point.  Is this
> possible and if it is what is the correct syntax?  In addition, does it
> work on all fields including fields such as the unique key field etc?
>
>
>
> Thanks in advance for your help
>
> Raj
>
>
>
>