Query Parser merged copy / non-dynamic filters
When more than one copy-level filter (e.g. locations()) is used in a
query-parser query, all but the first are ignored. The goal of this
work is to compress multiple copy-level filters into a single filter
that represents the full collection. Wherever possible, boolean
structures will be honored, to the extent possible for post-search
copy-level filters.
Examples:
concerto locations(1,2) locations(3,4)
==> concerto locations(1,2,3,4)
( concerto locations(3,4,5) ) || (piano locations(3,5,7) )
==> ( concerto || piano ) locations(3,4,5,6,7)
( concerto locations(3,4,5) ) && ( piano locations(3,5,7) )
==> concerto piano locations(3,5)
Note, in the last 2 examples, the final query does not exactly match the
original. This is because copy-level filters are applied after the
initial search and cannot be executed as part of the nested query. The
best we can do is create a representation of the final copy-level
filter, based on the nesting, and apply it to the final result of the
nested search.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>