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 Paul Tomblin <pt...@xcski.com> on 2009/08/20 16:48:18 UTC

Wildcard seaches?

Is there such a thing as a wildcard search?  If I have a simple
solr.StrField with no analyzer defined, can I query for "foo*" or
"foo.*" and get everything that starts with "foo" such as 'foobar" and
"foobaz"?

-- 
http://www.linkedin.com/in/paultomblin

Re: Wildcard seaches?

Posted by Paul Tomblin <pt...@xcski.com>.
On Thu, Aug 20, 2009 at 10:51 AM, Andrew Clegg<an...@gmail.com> wrote:
> Paul Tomblin wrote:
>>
>> Is there such a thing as a wildcard search?  If I have a simple
>> solr.StrField with no analyzer defined, can I query for "foo*" or
>> "foo.*" and get everything that starts with "foo" such as 'foobar" and
>> "foobaz"?
>>
>
> Yes. foo* is fine even on a simple string field.

Ah, I discovered what was going wrong - I was passing the url to
ClientUtils.escapeQueryChars, and that was escapign the *.  I have to
pass the URL without the * to escapeQueryChars, then tag the * on the
end.

Thanks.

-- 
http://www.linkedin.com/in/paultomblin

Re: Wildcard seaches?

Posted by Andrew Clegg <an...@gmail.com>.


Paul Tomblin wrote:
> 
> Is there such a thing as a wildcard search?  If I have a simple
> solr.StrField with no analyzer defined, can I query for "foo*" or
> "foo.*" and get everything that starts with "foo" such as 'foobar" and
> "foobaz"?
> 

Yes. foo* is fine even on a simple string field.

Andrew.

-- 
View this message in context: http://www.nabble.com/Wildcard-seaches--tp25063582p25063623.html
Sent from the Solr - User mailing list archive at Nabble.com.