Question about java api with multiple filters combination


I have 3 different filters OrFilterBuilder, RangeFilterBuilder,
PrefixFilterBuilder. I'd like to combine those filter and have an "and"
relation among them. FilterBuilders.andFilter(filter1, filter2, filter3)
would work; however, filter1, filter2, filter3 could be null. Is there a
better way of combining those rather than nested if else?


You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit