Re: Exact phrase match - city names example

2014-02-27 Thread thale jacobs
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

Re: Exact phrase match - city names example

2014-02-27 Thread Binh Ly
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

Re: Exact phrase match - city names example

2014-02-27 Thread thale jacobs
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,

Re: Exact phrase match - city names example

2014-02-26 Thread prashy
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

Re: Exact phrase match - city names example

2014-02-26 Thread thale jacobs
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

Re: Exact phrase match - city names example

2014-02-26 Thread Binh Ly
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

Re: Exact phrase match - city names example

2014-02-26 Thread Binh Ly
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

Re: Exact phrase match - city names example

2014-02-26 Thread thale jacobs
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