Hi Sundeep,
The simplified explanation is that terms are indexed to be more prefix search 
friendly (and that is why Amrit suggested that you index term reversed if you 
want leading wildcard). If you use leading wildcard, there is no structure to 
limit terms that can be matched and engine has to check every term and see if 
it matches provided suffix. That mean that latency depends on cardinality of 
your field. And when matching terms are found, engine has to create OR query 
using all matched term - more terms matched, longer it will take to execute 
query (this explanation also applies to regular wildcard queries - if you have 
short prefix that results in many terms being matched, it will be slow).

HTH,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 18 Nov 2017, at 01:42, Amrit Sarkar <sarkaramr...@gmail.com> wrote:
> 
> Sundeep,
> 
> You would like to explore
> http://lucene.apache.org/solr/6_6_1/solr-core/org/apache/solr/analysis/ReversedWildcardFilterFactory.html
> here probably.
> 
> Thanks
> Amrit Sarkar
> 
> On 18 Nov 2017 6:06 a.m., "Sundeep T" <sundeep....@gmail.com> wrote:
> 
>> Hi,
>> 
>> We have several indexed string fields which is not tokenized  and does not
>> have docValues enabled.
>> 
>> When we do leading wildcard searches on these fields they are running very
>> slow. We were thinking that since this field is indexed, such queries
>> should be running pretty quickly. We are using Solr 6.6.1. Anyone has ideas
>> on why these queries are running slow and if there are any ways to speed
>> them up?
>> 
>> Thanks
>> Sundeep
>> 

Reply via email to