# Query String query is not accepting analyzer which defined in settings

**URL:** <https://discuss.elastic.co/t/query-string-query-is-not-accepting-analyzer-which-defined-in-settings/22850>\
**Category:** Elasticsearch\
**Created:** [March 24, 2015, 10:01am UTC](https://discuss.elastic.co/t/query-string-query-is-not-accepting-analyzer-which-defined-in-settings/22850 "2015-03-24T10:01:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anusha](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@Anusha](https://discuss.elastic.co/u/Anusha)\
**Post date:** [March 24, 2015, 10:01am UTC](https://discuss.elastic.co/t/query-string-query-is-not-accepting-analyzer-which-defined-in-settings/22850/1 "2015-03-24T10:01:40Z")

</div>

Hi Team,

I kept the following settings for an index facebook..

PUT /facebook  
{  
"settings" : {  
"analysis": {  
"analyzer": {  
"wordAnalyzer": {  
"type": "custom",  
"tokenizer": "whitespace",  
"filter": [  
"word\_delimiter\_for\_phone"  
]  
}  
},  
"filter": {  
"word\_delimiter\_for\_phone": {  
"type": "word\_delimiter",  
"catenate\_all": true,  
"generate\_number\_parts ": false,  
"split\_on\_case\_change": false,  
"generate\_word\_parts": false,  
"split\_on\_numerics": false,  
"preserve\_original": true  
}  
}  
}  
},  
"mapping":{  
"face": {  
"properties": {  
"id": {  
"type": "string"  
},  
"name": {  
"type": "string"  
}  
}  
}  
}  
}

I would like to retrieve the data by preserving the special characters in  
the search term as it is, which is having special characters like -, /, ( ,  
) ,  
for this I have used the above analyzer and filter settings.

When am using query :

GET facebook/face/\_search  
{  
"query": {

```
  "bool": {
      "must": [
         {
             "query_string": {
                "fields": [
                   "id","name"
                ],
                "query": "a/",
                "analyzer":"wordAnalyzer"
             }
         }
      ]
  }

```

}

}

Showing error as:

"error": "SearchPhaseExecutionException[Failed to execute phase [query],  
all shards failed; shardFailures {[0IYtu1aLQ2qxfwLnbCFTHg][facebook][0]:  
SearchParseException[[facebook][0]: from[-1],size[-1]: Parse Failure  
[Failed to parse source ....................................

I would like to preserve the special characters while searching how can I  
achieve this? do I need to change my query (or ) may I get any query to  
search the term in different fields by preserving the special characters.

--  
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/eb395416-f991-45c7-b24b-960438f2d625%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/eb395416-f991-45c7-b24b-960438f2d625%40googlegroups.com).  
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, 12:24am UTC](https://discuss.elastic.co/t/query-string-query-is-not-accepting-analyzer-which-defined-in-settings/22850/2 "2017-07-06T00:24:31Z")

</div>


