|
I have a problem with the introduction of these deletion query types. If anything I would expect that deleteByQuery to take a Lucene query. Adding new query types just for this use case seems wrong to me. Also I have a hard time making sense of CustomBehaviour as a class name in this context. Also, SearchFactory is probably not the place to host this method. If anything it should be FullTextSession.
IMO the better approach would be to start with allowing purge with an array of ids. You would indeed to a projection query first to get the ids and then pass them to purge. As a second step one could then maybe add FullTextSession#deleteByQuery which takes a Lucene query. Under the hood it could in a first cut implementation do the projection + purge approach. In the longer term we can then look at better ways of implementing this.
|