I need to delete some documents during full-import with dataimporter.request.clean == false
. This limits the options open to me and it seems that using $deleteDocById
would be my best option. However I cannot find a good example of how to achieve this.
I am using sometihing along the lines of:
<document>
<entity query="select id, text
IF(yadda.dateyyy <= NOW(),yadda.id,NULL) AS $deleteDocById,
IF(yadda.dateyyy <= NOW(),yadda.id,NULL) AS $skipDoc,
from yadda">
</entity>
</document>
the GET parameters ?command=full-import&clean=false
seems to trigger correctly with the final report including Indexing completed. Added/Updated: 72 documents. Deleted 4 documents.
however when query the supposedly deleted documents are still in the index.
$skipDoc
needed to be set to the string value "true"
in order for this to work.
<document>
<entity query="select id, text
IF(yadda.dateyyy <= NOW(),yadda.id,NULL) AS $deleteDocById,
IF(yadda.dateyyy <= NOW(),"true",NULL) AS $skipDoc,
from yadda">
</entity>
</document>