Does not match words exactly

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" -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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/09ed56d0-2d31-4f95-a101-1d8dff032a5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

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

Thanks!

--Alex

On Tue, Apr 29, 2014 at 4:08 PM, Brian Lamb
brian.lamb@researchsquare.comwrote:

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" -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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/09ed56d0-2d31-4f95-a101-1d8dff032a5e%40googlegroups.comhttps://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.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-OeZS8EV8nrPbBOmBfVBFC%3DArzjXJTsECLD9ypkfANTw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.