Can search Elasticsearch 5.0 (Windows) using simple query, but prefixed with field name fails (search by example) <p>I am trying to get "search by example" functionality out of ElasticSearch. I have a number of objects which have fields, e.g. name, description, objectID, etc. I want to perform a search where, for example, "name=123" and "description=ABC"</p> <p>Mapping:</p> <pre><code>{ "settings": { "number_of_replicas": 1, "number_of_shards": 3, "refresh_interval": "5s", "index.mapping.total_fields.limit": "500" }, "mappings": { "CFS": { "_routing": { "required": true }, "properties": { "objectId": { "store": true, "type": "keyword", "index": "not_analyzed" }, "name": { "type": "text", "analyzer": "standard" }, "numberOfUpdates": { "type": "long" }, "dateCreated": { "type": "date", "format": "strict_date_optional_time||epoch_millis" }, "lastModified": { "type": "date", "format": "strict_date_optional_time||epoch_millis", "index": "not_analyzed" } } } } </code></pre> <p>}</p> <p>Trying a very simple search, without field name, gives correct result:</p> <p>Request: GET <a href="http://localhost:9200/repository/CFS/_search?routing=CFS&amp;q=CFS3" rel="nofollow noreferrer">http://localhost:9200/repository/CFS/_search?routing=CFS&amp;q=CFS3</a></p> <p>Returns:</p> <pre><code>{ "took": 1, "timed_out": false, "_shards": { "total": 1, "successful": 1, "failed": 0 }, "hits": { "total": 1, "max_score": 0.7831944, "hits": [ { "_index": "repository", "_type": "CFS", "_id": "589a9a62-1e4d-4545-baf9-9cc7bf4d582a", "_score": 0.7831944, "_routing": "CFS", "_source": { "doc": { "name": "CFS3", "description": "CFS3Desc", "objectId": "589a9a62-1e4d-4545-baf9-9cc7bf4d582a", "lastModified": 1480524291530, "dateCreated": 1480524291530 } } } ] } } </code></pre> <p>But trying to prefix with a field name fails (and this happens on all fields, e.g. objectId):</p> <p>Request: GET <a href="http://localhost:9200/repository/CFS/_search?routing=CFS&amp;q=name:CFS3" rel="nofollow noreferrer">http://localhost:9200/repository/CFS/_search?routing=CFS&amp;q=name:CFS3</a></p> <p>Returns:</p> <pre><code>{ "took": 6, "timed_out": false, "_shards": { "total": 1, "successful": 1, "failed": 0 }, "hits": { "total": 0, "max_score": null, "hits": [] } } </code></pre> <p>Eventually I want to do something like:</p> <pre><code>{ "bool" : { "must" : [ { "wildcard" : { "name" : { "wildcard" : "*CFS3*", "boost" : 1.0 } } }, { "wildcard" : { "description" : { "wildcard" : "*CFS3Desc*", "boost" : 1.0 } } } ] } } </code></pre> <p>Maybe related? When I try to use a "multi_match" to do this, I have to prefix my field name with a wildcard, e.g.</p> <pre><code>POST http://localhost:9200/repository/CFS/_search?routing=CFS { "query": { "multi_match" : { "query" : "CFS3", "fields" : ["*name"] } } } </code></pre> <p>If I don't prefix it, it doesn't find anything. I've spent 2 days searching StackOverflow and the ElasticSearch documentation. But these issues don't seem to be mentioned. There's lots about wildcards for search terms, and even mention of wildcards AFTER the field name, but nothing about BEFORE the field name. What piece of information am I missing from the field name, that I need to deal with by specifying a wildcard?</p> <p>I think the types of my fields in the mapping are correct. I'm specifying an analyzer.</p>