The idea, discussed during our last face-to-face meeting, was to be able to re-use search predicates or sorts because they may be expensive to build. That means returning SearchPredicate (or SearchSort objects to the user, and allowing to pass them to the query DSL later. Re-use would be allowed:
- between two search queries of the same search target
- maybe, between two compatible search targets
What "compatible" means exactly has yet to be defined. Two identical search targets (same targeted indexes) are compatible for sure, so I think we should start with this definition, and extend it later if need be. We should also decide if we want to perform runtime checks when re-using A preliminary implementation is already present in the proof-of-concept. However:
- the fact that predicates/sorts can be re-used is not tested
- we do not perform any runtime checks to validate that a given predicate/sort can be used in a given search query (that the search target it originated from is compatible with the one the query originated from)
|