I have a search index, products, containing a field named tags, which is an array. Tags values appears in results when I don't add a fields section to my query, but when I do, it's just ignored outright, and doesn't appear in results, as shown below.
$ curl -XPOST 'http://localhost:9200/products/_search?pretty' -d '{ "query": {"match_all": {} }, "fields": ["tags", "id", "slug"], "size": 2}'
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 321826,
"max_score" : 1.0,
"hits" : [ {
"_index" : "products",
"_type" : "products",
"_id" : "39969794",
"_score" : 1.0,
"fields" : {
"id" : [ "39969794" ],
"slug" : [ "slug-39969794" ]
}
}, {
"_index" : "products",
"_type" : "products",
"_id" : "21296413",
"_score" : 1.0,
"fields" : {
"id" : [ "21296413" ],
"slug" : [ "slug-21296413" ]
}
} ]
}
}
Is there a reason or known issue for this? Is tags some kind of reserved word for ElasticSearch?
I'm using ES version 1.1.2 (Lucene 4.7).
productsindex? And maybe the source for those two docs? - Sloan Ahrens