# Wildcard / regexp search over non analyzed fields

**URL:** <https://discuss.elastic.co/t/wildcard-regexp-search-over-non-analyzed-fields/46968>\
**Category:** Elasticsearch\
**Created:** [April 11, 2016, 9:44am UTC](https://discuss.elastic.co/t/wildcard-regexp-search-over-non-analyzed-fields/46968 "2016-04-11T09:44:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dens\_Fischer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dens_fischer/32/9047_2.png) [@Dens\_Fischer](https://discuss.elastic.co/u/Dens_Fischer)\
**Post date:** [April 11, 2016, 9:44am UTC](https://discuss.elastic.co/t/wildcard-regexp-search-over-non-analyzed-fields/46968/1 "2016-04-11T09:44:02Z")

</div>

Hi out there,

i try to send some wildcard/regexp querys to ElasticSearch - but somehow the requests fail.  
I am using  
[version] =\> Array  
(  
[number] =\> 2.2.1  
[lucene\_version] =\> 5.4.1  
)

and my query looks like  
$Query = array(  
"query" =\> array(  
"bool" =\> array(   
"must" =\> array(  
"wildcard" =\> array( "category" =\> "A?"),   
),   
"filter" =\> array (  
"match" =\> array( 'active' =\> '1'),  
)  
),  
)  
);

I expect to get all documents where the category is named like "AA", "AB", AC" - but unfortunately i always get an empty result, without any error message.

Can somebody help me finding out what i am missing?  
Thx!

---

<div class="post-metadata">

**Author:** ![Dens\_Fischer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dens_fischer/32/9047_2.png) [@Dens\_Fischer](https://discuss.elastic.co/u/Dens_Fischer)\
**Post date:** [April 12, 2016, 10:46am UTC](https://discuss.elastic.co/t/wildcard-regexp-search-over-non-analyzed-fields/46968/2 "2016-04-12T10:46:23Z")

</div>

After playing around for a while i was able to figure out that ES stores all strings in lowercase, so simply using "a?" instead of "A?" solved my problem.

Would be nice to have that a little bit clearer in the terms documentation.

---

<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 5, 2017, 11:00pm UTC](https://discuss.elastic.co/t/wildcard-regexp-search-over-non-analyzed-fields/46968/3 "2017-07-05T23:00:14Z")

</div>


