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": ["E Main St"]}'
curl -s -XPUT 'localhost:9200/test/name/6' -d '{ "street": ["W Main St"] }'
curl -s -XPUT 'localhost:9200/test/name/7' -d '{ "street": ["East Main Rd"] 
}'
curl -s -XPUT 'localhost:9200/test/name/8' -d '{ "street": ["West Main Rd"] 
}'
curl -s -XPUT 'localhost:9200/test/name/9' -d '{ "street": ["Main"] }'
curl -s -XPUT 'localhost:9200/test/name/10' -d '{ "street": ["Main St"] }'

Then I do this:

curl -XGET "localhost:9200/test/_search?pretty" -d '{
   "query":{
      "bool":{
         "must":[
            {
               "match":{
                  "street":{
                     "query":"Main"
                  }
               }
            }
         ]
      }
   }
}

I get back this:

{
  "hits" : {
    "hits" : [ {
      "_index" : "test",
      "_type" : "name",
      "_id" : "9",
      "_score" : 0.30685282, "_source" : { "street": ["Main"] }
    } ]
  }
}

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/13b6abb4-c58e-44f3-bfad-303b677b5284%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to