elasticsearch - How to extract specific terms from a field during indexing and copy the terms to another field? -
i indexing document elasticsearch:
curl -xput 'localhost:9200/vendor_v2/items/1?pretty' -d '{ "title": "pretty hats - green hat bold head", "url": "http://hatshop.com/greenhat", "timestamp": "2014-11-28t23:40:36.630917", "regularprice": "16,34", "id": "1a99c2871df4351044f32c96b96c93d1" }'
i use plugin, script or analyzer takes terms found in "title" field (whitespace based tokenizer) , runs them against 3 "term lists" (list brand names, list colors , list product types).
matching terms shall copied 3 new fields in indexed document. final indexed document should this.
{ "title": "pretty hats - green hat bold head", "color": "green", "brand": "pretty hats", "producttype": "hat", "url": "http://hatshop.com/greenhat", "timestamp": "2014-11-28t23:40:36.630917", "regularprice": "16,34", "id": "1a99c2871df4351044f32c96b96c93d1" }
is possible elasticsearch while indexing? or need take care of in application?
Comments
Post a Comment