# Indexing and searching for string '?'

**URL:** <https://discuss.elastic.co/t/indexing-and-searching-for-string/20445>\
**Category:** Elasticsearch\
**Created:** [October 27, 2014, 11:52am UTC](https://discuss.elastic.co/t/indexing-and-searching-for-string/20445 "2014-10-27T11:52:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Topper1](https://avatars.discourse-cdn.com/v4/letter/m/7bcc69/32.png) [@Mike\_Topper1](https://discuss.elastic.co/u/Mike_Topper1)\
**Post date:** [October 27, 2014, 11:52am UTC](https://discuss.elastic.co/t/indexing-and-searching-for-string/20445/1 "2014-10-27T11:52:17Z")

</div>

Hello,

when trying a match query on a string field to match the string '???' i am  
getting nothing back from elasticsearch.

It seems like the standard analyzer is just stripping this string out when  
tokenizing. probably because its treating a ? as a end of word and  
filtering it out?

when doing \_analyze?analyzer=standard&pretty' -d 'this is a ??? test'

I get back the response below which seems to confirm that. Is there any  
way where I could still be filtering out "?" at the end of words, but if  
there are multiple '??' it doesn't strip them?

{

"tokens" : [ {

```
"token" : "this",

"start_offset" : 0,

"end_offset" : 4,

"type" : "<ALPHANUM>",

"position" : 1

```

}, {

```
"token" : "is",

"start_offset" : 5,

"end_offset" : 7,

"type" : "<ALPHANUM>",

"position" : 2

```

}, {

```
"token" : "a",

"start_offset" : 8,

"end_offset" : 9,

"type" : "<ALPHANUM>",

"position" : 3

```

}, {

```
"token" : "test",

"start_offset" : 15,

"end_offset" : 19,

"type" : "<ALPHANUM>",

"position" : 4

```

} ]

}

--  
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/CALdNed%2BCGeR\_92B%3DH%2BnS3FY%3DuiXH0Q6ShJV\_Jg\_awbQ2bH3sbQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALdNed%2BCGeR_92B%3DH%2BnS3FY%3DuiXH0Q6ShJV_Jg_awbQ2bH3sbQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [October 27, 2014, 12:06pm UTC](https://discuss.elastic.co/t/indexing-and-searching-for-string/20445/2 "2014-10-27T12:06:11Z")

</div>

Exactly default standard analyzer is meant for text analysis. ??? is not a word either a number so it's removed.  
If you need to analyze that, you should try to use another analyzer like: [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-whitespace-analyzer.html#analysis-whitespace-analyzer](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-whitespace-analyzer.html#analysis-whitespace-analyzer)

--  
David Pilato | Technical Advocate | [elasticsearch.com](http://elasticsearch.com)  
[david.pilato@elasticsearch.com](mailto:david.pilato@elasticsearch.com)  
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 27 octobre 2014 à 12:53:01, Mike Topper ([topper@gmail.com](mailto:topper@gmail.com)) a écrit:

Hello,

when trying a match query on a string field to match the string '???' i am getting nothing back from elasticsearch.

It seems like the standard analyzer is just stripping this string out when tokenizing. probably because its treating a ? as a end of word and filtering it out?

when doing \_analyze?analyzer=standard&pretty' -d 'this is a ??? test'

I get back the response below which seems to confirm that. Is there any way where I could still be filtering out "?" at the end of words, but if there are multiple '??' it doesn't strip them?

{

"tokens" : [ {

```
"token" : "this",

"start_offset" : 0,

"end_offset" : 4,

"type" : "<ALPHANUM>",

"position" : 1

```

}, {

```
"token" : "is",

"start_offset" : 5,

"end_offset" : 7,

"type" : "<ALPHANUM>",

"position" : 2

```

}, {

```
"token" : "a",

"start_offset" : 8,

"end_offset" : 9,

"type" : "<ALPHANUM>",

"position" : 3

```

}, {

```
"token" : "test",

"start_offset" : 15,

"end_offset" : 19,

"type" : "<ALPHANUM>",

"position" : 4

```

} ]

}

--  
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/CALdNed%2BCGeR\_92B%3DH%2BnS3FY%3DuiXH0Q6ShJV\_Jg\_awbQ2bH3sbQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CALdNed%2BCGeR_92B%3DH%2BnS3FY%3DuiXH0Q6ShJV_Jg_awbQ2bH3sbQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
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/etPan.544e3533.216231b.91d6%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.544e3533.216231b.91d6%40MacBook-Air-de-David.local).  
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:53am UTC](https://discuss.elastic.co/t/indexing-and-searching-for-string/20445/3 "2017-07-06T00:53:44Z")

</div>


