Hi, 
I have the following document mapping: 
{
    "asset": {
        "properties": {
            "name": {
                "analyzer": "keyword",
                "store": true,
                "type": "string"
            },
            "id": {
                "index": "not_analyzed",
                "type": "string"
            }
        }
    }
}
Notice the *keyword* analyzer - the name *will contain whitespace* - and so 
I need it not to be tokenized but instead treated as a single token. 

Here's a sample document (I removed some of the details for conciseness): 
{
            "_index": "local_defaultorg_asset",
            "_type": "asset",
            "_id": "jvMXDQYuSkqml3_QNfP_Gg",
            "_score": 1,
            "_source": {
               "id": null,
               "name": "yLYNQU ywYXzS",
            }
}

Now, I'm running the following query (generated by Spring Data, so I don't 
have a lot of control over it): 
{
  "from": 0,
  "query": {
    "bool": {
      "must": {
        "query_string": {
          "query": "yLYNQU ywYXzS",
          "fields": [
            "name"
          ]
        }
      }
    }
  }
}

But, unfortunately, I'm getting no results. 
In a similar situation but without the whitespace, everything looks good 
and the query's able to find my document. 
Am I missing anything on the mapping side?
Thanks, 
Eugen. 

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/9a8f9c9d-9227-42d2-aeae-4cdcf0236f08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to