I know I could query all Lucene documents matching my query and then delete them one by one by their ID but that would be quite cumbersome and slow.
Why is it so cumbersome? And would it really be slow? Would it help your use case, if there were a FullTextSession#purge(Class<T> entityType, Serializable... id) instead of just a FullTextSession#purge(Class<T> entityType, Serializable... id)?
I have written some extension classes that allow for deleteByQuery(...)-like behaviour here:
I have a bit of a hard time to understand on which class/interface you want to provide this functionality. Could you clarify your idea? It also looks like you are creating some new "query" classes? Would your approach not potentially create inconsistencies between index and data store?
|