# Simple query string and upper case prefixes

**URL:** <https://discuss.elastic.co/t/simple-query-string-and-upper-case-prefixes/16675>\
**Category:** Elasticsearch\
**Created:** [March 28, 2014, 11:13am UTC](https://discuss.elastic.co/t/simple-query-string-and-upper-case-prefixes/16675 "2014-03-28T11:13:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![morus\_walter\_ml](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@morus\_walter\_ml](https://discuss.elastic.co/u/morus_walter_ml)\
**Post date:** [March 28, 2014, 11:13am UTC](https://discuss.elastic.co/t/simple-query-string-and-upper-case-prefixes/16675/1 "2014-03-28T11:13:40Z")

</div>

Hi,

I'm trying to do a prefix query using the simple\_query\_string query.

The field I'm searching on it analyzed using an Analyzer named "unstemmed",  
which basically does lowercase, unicode normalisation and accent removal  
(à treated as a).

If I do a search for an uppercase prefix (e.g. Project\*) I get no results,  
while lowercase prefixes work.

The documentation on the simple query string query talks about a  
lowercase\_expanded\_terms option,  
which creates a query parsing exception, if I make it explicit (see below,  
full error message is  
QueryParsingException[[jobs\_v0002] [simple\_query\_string] unsupported field  
[lowercase\_expanded\_terms]])

But the default sould be true anyway, which should allow uppercase input  
anyway.

So question:  
Do I missunderstand something here?  
Do I do something wrong?  
Or is it broken?

The ES version is 1.0.1. see below for the full query.

Another question would be, if the simple query string query could (and  
should)  
be enhanced to allow to specify two analyzers. One for normal terms and one  
for  
prefixes and fuzzy queries.  
My problem here is, that even when lowercasing would work, there are cases  
left, where  
the prefix contains accents which would still fail to expand.  
(e.g. à\* would never find anything since à must be normalized to a)  
would that be possible?

best  
Morus

PS: the query I send is  
{  
"query": {  
"simple\_query\_string": {  
"analyzer": "unstemmed",  
"default\_operator": "and",  
"fields": [  
"fulltext.text"  
],  
"query": "Project\*"  
}  
}  
}

the attempt to make lowercase\_expanded\_tree explicit is  
{  
"query": {  
"simple\_query\_string": {  
"analyzer": "unstemmed",  
"default\_operator": "and",  
"lowercase\_expanded\_terms": true,  
"fields": [  
"fulltext.text"  
],  
"query": "Project\*"  
}  
}  
}  
full error is  
SearchPhaseExecutionException[Failed to execute phase [query\_fetch], all  
shards failed; shardFailures {[x34iS8VlRiyhDFKkiVUFTw][jobs\_v0002][0]:  
SearchParseException[[jobs\_v0002][0]: from[-1],size[-1]: Parse Failure  
[Failed to parse source  
[{"query":{"simple\_query\_string":{"analyzer":"unstemmed","default\_operator":"and","lowercase\_expanded\_terms":true,"fields":["fulltext.text"],"query":"Project\*"}}}]]];  
nested: QueryParsingException[[jobs\_v0002] [simple\_query\_string]  
unsupported field [lowercase\_expanded\_terms]]; }]  
status: 400

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f8bc56e6-7e34-445b-a542-5c55cf57835a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f8bc56e6-7e34-445b-a542-5c55cf57835a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Binh\_Ly\_2](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@Binh\_Ly\_2](https://discuss.elastic.co/u/Binh_Ly_2)\
**Post date:** [March 28, 2014, 1:13pm UTC](https://discuss.elastic.co/t/simple-query-string-and-upper-case-prefixes/16675/2 "2014-03-28T13:13:35Z")

</div>

Sorry, the lowercase\_expanded\_terms was added in 1.1 - that documentation  
page should be fixed. About your other question, you can experiment with  
the query\_string query instead which has an analyze\_wildcard flag - you  
still can't specify 2 analyzers, but you have have it try to analyze  
wildcards in your search terms.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8ed4fbb0-4d2f-4982-ad56-58ebc668b5b1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8ed4fbb0-4d2f-4982-ad56-58ebc668b5b1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![morus\_walter\_ml](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@morus\_walter\_ml](https://discuss.elastic.co/u/morus_walter_ml)\
**Post date:** [March 28, 2014, 3:24pm UTC](https://discuss.elastic.co/t/simple-query-string-and-upper-case-prefixes/16675/3 "2014-03-28T15:24:48Z")

</div>

Hallo Binh,

> Sorry, the lowercase\_expanded\_terms was added in 1.1 - that documentation  
> page should be fixed. About your other question, you can experiment with  
> the query\_string query instead which has an analyze\_wildcard flag - you  
> still can't specify 2 analyzers, but you have have it try to analyze  
> wildcards in your search terms.

ok. Thanks a lot for the explanation.

Actually I saw the 1.1 indicator on another new parameter (locale) for  
simple\_query\_string and felt save regarding the version...

best  
Morus

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/20140328162448.49168207%40tucholsky.experteer.muc](https://groups.google.com/d/msgid/elasticsearch/20140328162448.49168207%40tucholsky.experteer.muc).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 1:39am UTC](https://discuss.elastic.co/t/simple-query-string-and-upper-case-prefixes/16675/4 "2017-07-06T01:39:51Z")

</div>


