I have the following method that creates a BooleanPredicateClausesStep to do a query with.
private BooleanPredicateClausesStep<?> getJournalAndSpatialSearchCriteria(GeoFilter geoFilter, SearchPredicateFactory factory, Boolean includeJournalsWithStatusFinished) {
SearchPredicate journalLocationMustResideWithinRadius = getJournalsContainedWithinRadiusPredicate(geoFilter, factory);
SearchPredicate mustOrShouldBeOfStatus = getSubmissionStatusConditionPredicate(includeJournalsWithStatusFinished, factory);
return factory.bool()
.filter( journalLocationMustResideWithinRadius )
.filter( factory.match().field( "deleted" ).matching( "false" ) )
.filter( mustOrShouldBeOfStatus )
.filter( factory.match().field( "containsHarvestEntry" ).matching( "true" ) )
.filter( factory.match().field( "grownOutdoors" ).matching( "true" ) );
}
It contains one spatial search predicate that checks whether journals fall within a predefined circular geographical area or not. All the other filters are simple ones that only check whether a certain field matches a value or not.
My question is: Do all these filters get implemented sequentially or all at once? Or to put it differently; would lucene first fetch all of the objects that fall within the defined geographical area before it checks whether they are deleted or does it check both simultaneously? The hibernate search documentation doesn't say anything about the order in which filters are processed.