EQL record filters let you define arbitrary subsets of the total record set, and dynamically restrict search and navigation results to these subsets.
<Request> <State> <DataSourceFilterString>PROD_CATEGORY = 'Hardware'</DataSourceFilterString> <SelectionFilterString>AMOUNT_SOLD > 1000</SelectionFilterString> </State> ... </Request>
More details on the available EQL operators and functions are listed in a later topic.
The DataSourceFilterString component filters the corpus of records before any other processing is done. In other words, this filter is applied first, and makes the universe of data that is visible to your query smaller. This means that filtered-out records will not contribute to spell correction, and will not be available as part of AllBaseRecords in EQL.
Because DataSourceFilterString restricts the searchable records to a specified subset of the total records in the Dgraph, it can be used as a security filter to prevent users from obtaining records that they are not authorized to view. In EQL terms, AllBaseRecords corresponds to the records that pass the DataSourceFilterString filter.
After the universe of records has been narrowed by DataSourceFilterString, the SelectionFilterString component is used for additional application-level filtering. It specifies the criteria for the final record result set. The results that are returned are the records that match all of the filters specified in the query.
SelectionFilterString also determines which data is available for refinement computation. NavStateRecords corresponds to the records that pass all filters (including SelectionFilterString).
You may not have more than one DataSourceFilter across State and Operators You may not have more than one SelectionFilter across State and Operators
In this case, you can remove the extraneous filter(s) and rewrite the one filter with AND or OR operators to specify multiple conditions in the filter.
No Dgraph process configuration flags are necessary to enable EQL record filters.