Index only some fields in ElasticSearch from mongodb -


i'm using elasticsearch 0.90.2 , elasticsearch-river-mongodb 1.7.0 retrieve data mongodb's oplog. in collection i'm trying index have thousands of structured records, let's named them 'field1', 'field2', 'field3'...'field10'

is there way index 'field1' , 'field2' ? matter if these strings or date objects ?

thanks

i never used river plugins, 1 thing know can control index upon fields through mapping or template. each field, can specify property "index", in mapping or template, 3 different options: analyzed, not_analyzed, no. official documentation.

set analyzed field indexed , searchable after being broken down token using analyzer. not_analyzed means still searchable, not go through analysis process or broken down tokens. no means won’t searchable @ (as individual field; may still included in _all). setting no disables include_in_all. defaults analyzed.

if want field still searchable, go "not_analyzed", otherwise "no". type of fields should not matter.

here mapping example official website

{     "tweet" : {         "properties" : {             "user" : {"type" : "string", "index" : "not_analyzed"},             "message" : {"type" : "string", "null_value" : "na"},             "postdate" : {"type" : "date"},             "priority" : {"type" : "integer"},             "rank" : {"type" : "float"}         }     } } 

Comments