When CouchDB deletes a document, the change event does not include the
document. So if your filter function is something like:
return doc.type == 'product'
then it's filtering out the delete events. There's nothing that
Elasticsearch can do in this case unfortunately. You just have to
design around it by not filtering delete events.
does it actually work if I remove the filter or do I have to do something
else?
I read that issue a few times before but I guess I am not fully
understanding it. If you delete something the change feed will show a
delete message with the document id right? The document id is unique inside
a couchdb database so couldn't you use that to delete it from the index or
is it a problem if one elasticsearch instance is feeding of different
couchDB databases so you can't be sure the id is unique?
does it actually work if I remove the filter or do I have to do something else?
I read that issue a few times before but I guess I am not fully understanding it. If you delete something the change feed will show a delete message with the document id right? The document id is unique inside a couchdb database so couldn't you use that to delete it from the index or is it a problem if one elasticsearch instance is feeding of different couchDB databases so you can't be sure the id is unique?
CouchDB is sending the delete message but your filter function is
preventing it from going to Elasticsearch.
I assume your filter function looks like this"
return doc.type == 'product'
Well that will filter out deleted document events because the only
fields a deleted document as are _id, _rev, and _deleted. By saying it
must also have a type field, your filter is rejecting the delete
event.
If you want the delete events to pass through your filter you need to
do something like
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.