# Leading Wildcard Performance?

**URL:** <https://discuss.elastic.co/t/leading-wildcard-performance/3753>\
**Category:** Elasticsearch\
**Created:** [January 7, 2011, 6:52pm UTC](https://discuss.elastic.co/t/leading-wildcard-performance/3753 "2011-01-07T18:52:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ibivibiv](https://avatars.discourse-cdn.com/v4/letter/i/7ab992/32.png) [@ibivibiv](https://discuss.elastic.co/u/ibivibiv)\
**Post date:** [January 7, 2011, 6:52pm UTC](https://discuss.elastic.co/t/leading-wildcard-performance/3753/1 "2011-01-07T18:52:24Z")

</div>

I am currently evaluating multiple search/indexing solutions and the one thing I can't find any the mailing list or in any blogs/doc pages is improving leading wildcard query times. Several other implementations of API's on top of Lucene offer some different solutions (sometimes doing a forward and reverse index etc.) to improve query times. Is there something similar implemented in Elastic? Maybe something I missed in the index docs? I checked the settings there for things like storage but it is more about where and FS type settings. Nothing on how to implement anything like what I was looking for?

---

<div class="post-metadata">

**Author:** ![ibivibiv](https://avatars.discourse-cdn.com/v4/letter/i/7ab992/32.png) [@ibivibiv](https://discuss.elastic.co/u/ibivibiv)\
**Post date:** [January 9, 2011, 7:21pm UTC](https://discuss.elastic.co/t/leading-wildcard-performance/3753/2 "2011-01-09T19:21:28Z")

</div>

It looks like I get about a 10 sec penalty if I do a query like:

\_all:_foo_

over if I do the a query like this:

\_all:foo\* or even

\_all:fo_o_

Is this just the cost of doing a leading wildcard or is there a way around taking that performance hit?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 4:14am UTC](https://discuss.elastic.co/t/leading-wildcard-performance/3753/3 "2017-07-06T04:14:07Z")

</div>


