>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)?
Well imagine I want to delete all documents in my index that are older than 1 year in an index with some 100.000 documents and more than half of these documents are matching that query. Then I would have to read all these documents (or at least the projection with the ids) into memory and then delete them one by one when I could have just done that in the lucene index in the first place. Directly deleting on the Index would definitely be faster (and less annoying).
>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?
For now I would be perfectly happy to see this functionality only in the engine since that's what I am using. I created a new Work class that can be passed to Worker#performWork(...). Ultimately a nicer to use version wouldn't be that bad in the FullTextSession in ORM to be honest.
|