scrapy-elasticsearch
scrapy-elasticsearch copied to clipboard
is it possible update item if this item with id exists?
Is it possible update item if this item with same id already exists in elastic instead of adding new one? I mean: { itemId: 1, color: ['red', 'blue'] } { itemId: 1, color: ['green'] }
result: { itemId: 1, color: ['red', 'blue', 'green'] }
did you set a uniq field?
just roughly read the code, you would find the _id field is a hash of your unique fields. i guess the same unique fields together would lead you to the same id. with the python elasticsearch.index api it updates the entry if the id is specified and exists in the database.