i trying re-index documents in order them sortable requires making sortable fields multi-field properties "raw" version of string not analyzed.
i following this article, still getting errors when searching documents sorting query.
i have question regarding re-indexing of data... if re-index doucments new index, need have logic set analyzed version , non_analyzed or "raw" version of string well? or elastic search automatically fill one? here field looks like:
{ "entityname": { "type":"string", "fields": { "raw": { "type":"string", "index":"not_analyzed" } } } }
so when index document _source
like:
{ ... "entityname":"ned stark" ... }
will mapping both analyzed
field and not_analyzed
field complete or there else have tell indexing fill in "raw" property well?
no, don't need else.
after reindexing documents, must tell fields query should use in given documentation article.
raw subfield:
post /_search { "query": { "match": { "entityname.raw": "foo-bar" } } }
or original analysed type:
post /_search { "query": { "match": { "entityname": "foo-bar" } } }
Comments
Post a Comment