Understanding When Filters Are Accurate
- Last Updated: April 14, 2026
- 1 minute read
- MarkLogic Server
- Version 12.0
- Documentation
When you use -directory_filter, -collection_filter, or -document_selector without -query_filter, the set of documents selected by mlcp exactly matches your filtering criteria.
The query you supply with -query_filter is used in an unfiltered search, which means there can be false positives among the selected documents. When you combine -query_filter with -directory_filter, -collection_filter, or -document_selector, mlcp might select documents that do not meet your directory, collection, or path filter criteria.
The interaction between -query_filter and the other filtering options is similar to the following. In this example, the search can match documents that are not in the “parts” collection.
-collection_filter parts
-query_filter yourSerializedQuery
==> selects the documents to export similar to the following:
cts:search(
fn:collection("parts"),
yourQuery,
("unfiltered"))
For a complete example using -query_filter, see Example: Exporting Documents Matching a Query.
To learn more about the implications of unfiltered searches, see Fast Pagination and Unfiltered Searches in the Query Performance and Tuning Guide.