java - indexing numeric field as both int and string in elastic search -


how can index numeric field both integer , string using multi_field . multi_field deprecated now. how can achieve same using "fields" field in version 2.x. have heard field can indexing , analysed in different ways using "fields". can indexed different types in elastic search?

the issue facing classical numeric field search highlighting issue in elastic search.where not numeric fields highlighting. want index field string , int can search, highlight , perform range operations on data.

you can use fields have numeric string well:

{   "mappings": {     "test": {       "properties": {         "my_numeric": {           "type": "integer",           "fields": {             "as_string": {               "type": "string",               "index": "not_analyzed"             }           }         }       }     }   } } 

Comments

Popular posts from this blog

javascript - Hide toolbar of pdf file opened inside iframe using firefox -

Ansible - ERROR! the field 'hosts' is required but was not set -

Copy range with conditional formatting -