richardwilly98 / elasticsearch-river-mongodb

MongoDB River Plugin for ElasticSearch
1.12k stars 215 forks source link

Custom filter is ignored on update #180

Open neonal opened 10 years ago

neonal commented 10 years ago

I've added a custom filter in river configuration: "filter":"{\"o.foo\" : {$exists:true}}" and rebuilt the index. This filter is applied in insertions, however it is ignored on updates and objects which don't have field foo is added to index.

richardwilly98 commented 10 years ago

Unfortunately since release 1.7.3 the custom filter in river configuration is not used within MongoDB query so this query will not work. The main reason of this change for because of performance hit with large oplog.rs collection. But you should be able to achieve the same behavior using script filter [1]. Script filter is executed in all operations: insert, update, delete

[1] - https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#script-filters

richardwilly98 commented 10 years ago

@neonal Any update?

neonal commented 10 years ago

Nope. I didn't have a chance to try this. I'll post the result as soon as I used script filters.