# Wildcard query fault?

**URL:** <https://discuss.elastic.co/t/wildcard-query-fault/84823>\
**Category:** Elasticsearch\
**Created:** [May 6, 2017, 3:48pm UTC](https://discuss.elastic.co/t/wildcard-query-fault/84823 "2017-05-06T15:48:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbalicchia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fbalicchia/32/28669_2.png) [@fbalicchia](https://discuss.elastic.co/u/fbalicchia)\
**Post date:** [May 6, 2017, 3:48pm UTC](https://discuss.elastic.co/t/wildcard-query-fault/84823/1 "2017-05-06T15:48:41Z")

</div>

Hi,

I' ve a trouble with a particular field with my query that use wildcard  
I'm using Elasticsearch 2.3.5 and I' ve a a properties called sessionid mapped as

```
"sessionid" : {
         "type" : "string",
        "index" : "not_analyzed"
}

```

With this query  
{  
"from": 0,  
"size": 150,  
"query": {  
"bool": {  
"must": {  
"query\_string": {  
"query": "sessionid:"Ijd18yH8WskUyV5mCsJLGUf99ddGEaoiCmbjHRNeJNqk3yuLWdmhnf62m-mC6PBph82aajdX1xAFNm1EHwJ1VA== org.apache.jsp.isml2jsp.app\_005fjonny\_005fwhitelabel.default\_.components.product.gtm\_005finfo\_002d1\_002daa2fbdfa0b82a2a0d43ea8d785585808c58b82e2\_jsp"",  
"allow\_leading\_wildcard": true  
}  
}  
}  
}  
}  
It return results with exactly that sessionid, but when for example replace last '\_jsp' with char '\*' like this

{  
"from": 0,  
"size": 150,  
"query": {  
"bool": {  
"must": {  
"query\_string": {  
"query": "sessionid:"Ijd18yH8WskUyV5mCsJLGUf99ddGEaoiCmbjHRNeJNqk3yuLWdmhnf62m-mC6PBph82aajdX1xAFNm1EHwJ1VA== org.apache.jsp.isml2jsp.app\_005fjonny\_005fwhitelabel.default\_.components.product.gtm\_005finfo\_002d1\_002daa2fbdfa0b82a2a0d43ea8d785585808c58b82e2\*"",  
"allow\_leading\_wildcard": true  
}  
}  
}  
}  
}

It return 0 Hits instead I'm waiting at least value.

The problem seems to be tied to the field but it is defined as other that works

Have you a suggest to address this problem or tips to understand what going wrong ?

Thanks for help.

--Filippo

---

<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:** [June 3, 2017, 3:50pm UTC](https://discuss.elastic.co/t/wildcard-query-fault/84823/2 "2017-06-03T15:50:41Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
