# Query data with punctuation will leads a wrong query result

**URL:** <https://discuss.elastic.co/t/query-data-with-punctuation-will-leads-a-wrong-query-result/14837>\
**Category:** Elasticsearch\
**Created:** [December 12, 2013, 1:19pm UTC](https://discuss.elastic.co/t/query-data-with-punctuation-will-leads-a-wrong-query-result/14837 "2013-12-12T13:19:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chengji18](https://avatars.discourse-cdn.com/v4/letter/c/a4c791/32.png) [@chengji18](https://discuss.elastic.co/u/chengji18)\
**Post date:** [December 12, 2013, 1:19pm UTC](https://discuss.elastic.co/t/query-data-with-punctuation-will-leads-a-wrong-query-result/14837/1 "2013-12-12T13:19:33Z")

</div>

My case is store some words in index, every word get it's own ID. My query  
data is some message. When there are some punctuation in the query data  
message, it will give a wrong answer.

For instance, I store keyword "banana" and "green" and "pen" in the index.

My query data1: "is this banana?"

The result will be empty hits.

My query data2: "\>\> it is a pen"

The symbol "\>\>" will hits all the keywords in the index.

Without the punctuation the query result will works right.

Any idea about how to use elasticsearch setup to solve this?

Environment Configuration：

Ubuntu 12.04 desktop 64 bit Elasticsearch server in Ubuntu, version  
0.90.7,single node  
Client: pyelasticsearch Programing language: python

Thank you so much!

--  
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/f1238c65-0c2a-46d5-ac56-69ad149fed0e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f1238c65-0c2a-46d5-ac56-69ad149fed0e%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Andrew\_Cholakian\_2](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Andrew\_Cholakian\_2](https://discuss.elastic.co/u/Andrew_Cholakian_2)\
**Post date:** [December 13, 2013, 5:03am UTC](https://discuss.elastic.co/t/query-data-with-punctuation-will-leads-a-wrong-query-result/14837/2 "2013-12-13T05:03:25Z")

</div>

Can you post more information. Sample documents, sample queries, etc.

* * *

Andrew Cholakian  
Developer, Found Hosted Elasticsearch  
www.found.no, @foundsays

On Thursday, December 12, 2013 5:19:33 AM UTC-8, cml wrote:

> My case is store some words in index, every word get it's own ID. My query  
> data is some message. When there are some punctuation in the query data  
> message, it will give a wrong answer.
> 
> For instance, I store keyword "banana" and "green" and "pen" in the index.
> 
> My query data1: "is this banana?"
> 
> The result will be empty hits.
> 
> My query data2: "\>\> it is a pen"
> 
> The symbol "\>\>" will hits all the keywords in the index.
> 
> Without the punctuation the query result will works right.
> 
> Any idea about how to use elasticsearch setup to solve this?
> 
> Environment Configuration：
> 
> Ubuntu 12.04 desktop 64 bit Elasticsearch server in Ubuntu, version  
> 0.90.7,single node  
> Client: pyelasticsearch Programing language: python
> 
> Thank you so much!

--  
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/077d02c1-217b-4f21-958e-6cdb566eec65%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/077d02c1-217b-4f21-958e-6cdb566eec65%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:01am UTC](https://discuss.elastic.co/t/query-data-with-punctuation-will-leads-a-wrong-query-result/14837/3 "2017-07-06T02:01:32Z")

</div>


