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

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

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -