# Does not match words exactly

**URL:** <https://discuss.elastic.co/t/does-not-match-words-exactly/17265>\
**Category:** Elasticsearch\
**Created:** [April 29, 2014, 2:08pm UTC](https://discuss.elastic.co/t/does-not-match-words-exactly/17265 "2014-04-29T14:08:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Lamb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brian_lamb/32/1452_2.png) [@Brian\_Lamb](https://discuss.elastic.co/u/Brian_Lamb)\
**Post date:** [April 29, 2014, 2:08pm UTC](https://discuss.elastic.co/t/does-not-match-words-exactly/17265/1 "2014-04-29T14:08:55Z")

</div>

Hello all,

I'm running into a issue with elastic search where if I use a common terms  
query, it will not match the individual words in the query:

curl -XPOST "[http://localhost:9200/myIndex/\_search](http://localhost:9200/myIndex/_search)" -d'  
{  
"query" : {  
"bool" : {  
"should" : [  
{  
"common" : {  
"fieldA" : {  
"query" : "This is a sample sentence that I am  
searching on"  
}  
}  
},  
{  
"common" : {  
"fieldB" : {  
"query" : "This is another but completely different  
sample sentence that I am searching on"  
}  
}  
}  
]  
}  
},  
"filter" : {  
"range" : {  
"date" : {  
"gte": "1998-10-30 00:00:00",  
"lte": "1998-11-30 00:00:00"  
}  
}  
}  
}'

The issue I'm running into is that if my document contains the word  
"sentence", it is not returned. However, if it contains the word "sentence  
_s_", it will be returned. I need it to return the documents that contain  
the word "sentence".

What am I doing incorrectly?

Thanks,

Brian Lamb

--  
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/09ed56d0-2d31-4f95-a101-1d8dff032a5e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/09ed56d0-2d31-4f95-a101-1d8dff032a5e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [May 5, 2014, 10:20am UTC](https://discuss.elastic.co/t/does-not-match-words-exactly/17265/2 "2014-05-05T10:20:29Z")

</div>

Hey,

in order for others to follow it might make a lot of sense to provide a  
complete example, which can be used by others to rebuild your problem  
(instead of just supplying a query), see [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/help)

Thanks!

--Alex

On Tue, Apr 29, 2014 at 4:08 PM, Brian Lamb  
[brian.lamb@researchsquare.com](mailto:brian.lamb@researchsquare.com)wrote:

> Hello all,
> 
> I'm running into a issue with Elasticsearch where if I use a common terms  
> query, it will not match the individual words in the query:
> 
> curl -XPOST "[http://localhost:9200/myIndex/\_search](http://localhost:9200/myIndex/_search)" -d'  
> {  
> "query" : {  
> "bool" : {  
> "should" : [  
> {  
> "common" : {  
> "fieldA" : {  
> "query" : "This is a sample sentence that I am  
> searching on"  
> }  
> }  
> },  
> {  
> "common" : {  
> "fieldB" : {  
> "query" : "This is another but completely different  
> sample sentence that I am searching on"  
> }  
> }  
> }  
> ]  
> }  
> },  
> "filter" : {  
> "range" : {  
> "date" : {  
> "gte": "1998-10-30 00:00:00",  
> "lte": "1998-11-30 00:00:00"  
> }  
> }  
> }  
> }'
> 
> The issue I'm running into is that if my document contains the word  
> "sentence", it is not returned. However, if it contains the word "sentence  
> _s_", it will be returned. I need it to return the documents that contain  
> the word "sentence".
> 
> What am I doing incorrectly?
> 
> Thanks,
> 
> Brian Lamb
> 
> --  
> 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/09ed56d0-2d31-4f95-a101-1d8dff032a5e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/09ed56d0-2d31-4f95-a101-1d8dff032a5e%40googlegroups.com)[https://groups.google.com/d/msgid/elasticsearch/09ed56d0-2d31-4f95-a101-1d8dff032a5e%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/09ed56d0-2d31-4f95-a101-1d8dff032a5e%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> 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/CAGCwEM-OeZS8EV8nrPbBOmBfVBFC%3DArzjXJTsECLD9ypkfANTw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-OeZS8EV8nrPbBOmBfVBFC%3DArzjXJTsECLD9ypkfANTw%40mail.gmail.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, 1:31am UTC](https://discuss.elastic.co/t/does-not-match-words-exactly/17265/3 "2017-07-06T01:31:45Z")

</div>


