I get the same results as you using your example Thanks for posting
it. I am not sure why my original example does not work, but that is for
me to figure out! Thanks again.
On Thursday, June 14, 2012 2:02:28 PM UTC-4, Greg Silin wrote:
>
> Hi,
> One of our fields in the index stores city n
So if I do this:
curl -s -XPUT 'localhost:9200/test' -d '{
"mappings": {
"name": {
"properties": {
"street": {
"type": "string",
"index" : "not_analyzed"
}
}
}
}
}
Then I do this:
curl -s -XPUT 'localhost:9200/test/name/5' -d '{ "street
Thanks for the reply Prashy - I tried performing a term query like you
suggested; I get the same results (all documents containing main are
returned...E Main St, W Main St...) Do you only get one document returned
using the example I provided above (doc id 9/"Main")??
On Thursday, February 27,
Try using the term query as term query is not analyzed so it might search the
exact term only.
{
"query" : {
"term" : { "street" : "xxx" }
}
}
--
View this message in context:
http://elasticsearch-users.115913.n3.nabble.com/Exact-phrase-match-city-names-example-tp4019310p4050604.html
Sent from
Thanks for the reply Binh Ly - I think the mapping in your example are
almost like the example I posted and I believe are functionality the
equivalent. But my query against the not_analyzed fields return all the
docs with the word "Main" in themFrom the query side I also thought I
could sp
Thale,
Can you double check the mapping. Something seems off to me. Should be
something like this:
{
"mappings": {
"name": {
"properties": {
"street": {
"type": "string",
"index" : "not_analyzed"
}
}
}
}
}
And don't forget, not_analyze
Greg, to add to Colin's reply, try not_analyzed, or if you want
case-insensitive searches, then you can do a custom analyzer consisting of
keyword tokenizer + lowercase filter. You might also be interested in the
multi fields feature if you want to search on the same field in many
different way
I am having problem a similar problem too. Here is how I set it up the
test index:
Create the index:
curl -s -XPUT 'localhost:9200/test' -d '{
"mappings": {
"properties": {
"name": {
"street": {
"type": "string",
"in