Yes, wildcards can be slow. That's why I suggested that the use cases be reviewed more carefully.

But... using the reversed wildcard filter doesn't accomplish any good for the substring case where there is a wildcard on both ends.

A prefix wildcard query should actually deliver decent performance, as long as the prefix isn't too short (e.g., "cat*"). See PrefixQuery:
http://lucene.apache.org/core/4_9_0/core/org/apache/lucene/search/PrefixQuery.html

ngram filters can also be used, but... that can make the index rather large.

-- Jack Krupansky

-----Original Message----- From: Umesh Prasad
Sent: Wednesday, August 20, 2014 8:26 PM
To: solr-user@lucene.apache.org
Subject: Re: Substring and Case In sensitive Search

The performance of wild card queries and specially prefix wild card query
can be quite slow.

http://lucene.apache.org/core/4_9_0/core/org/apache/lucene/search/WildcardQuery.html

Also, you won't be able to time them out.

Take a look at ReversedWildcardFilter

http://lucene.apache.org/solr/4_9_0/solr-core/org/apache/solr/analysis/ReversedWildcardFilterFactory.html

The blog post describes it nicely ..

http://solr.pl/en/2011/10/10/%E2%80%9Ccar-sale-application%E2%80%9D-%E2%80%93-solr-reversedwildcardfilter-%E2%80%93-lets-optimize-wildcard-queries-part-8/



On 19 August 2014 22:19, Jack Krupansky <j...@basetechnology.com> wrote:

Substring search a string field using wildcard, "*", at beginning and end
of query term.

Case-insensitive match on string field is not supported.

Instead, copy the string field to a text field, use the keyword tokenizer,
and then apply the lower case filter.

But... review your use case to confirm whether you really need to use
"string" as opposed to "text" field.

-- Jack Krupansky

-----Original Message----- From: Nishanth S
Sent: Tuesday, August 19, 2014 12:03 PM
To: solr-user@lucene.apache.org
Subject: Substring and Case In sensitive Search


Hi,

I am  very new to solr.How can I allow solr search on a string field case
insensitive and substring?.

Thanks,
Nishanth




--
Thanks & Regards
Umesh Prasad
Search l...@flipkart.com

in.linkedin.com/pub/umesh-prasad/6/5bb/580/

Reply via email to