lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emir Arnautović <>
Subject Re: Leading wildcard searches very slow
Date Mon, 20 Nov 2017 09:00:27 GMT
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).

Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training -

> On 18 Nov 2017, at 01:42, Amrit Sarkar <> wrote:
> Sundeep,
> You would like to explore
> here probably.
> Thanks
> Amrit Sarkar
> On 18 Nov 2017 6:06 a.m., "Sundeep T" <> 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

View raw message