[BETA] Filtering
How to filter your search on sources.
This feature only works with for calls to the /search
endpoint using the outputType
sourcedAnswer
.
This guide includes an overview of error codes you might see from both the API and our SDKs.
Overview
Our /search
endpoint allows for restricting its search scope. It supports the following:
- Restrictions: restrict the search to a set list of sources
- Exclusions: exclude a set list of sources from the search
- Prioritization: create a prioritized list of sources to search on. The information will be looked for on the sources by order of priority
To filter, we use an XML format that must be appended to the natural language q
parameter passed to the /search
endpoint.
For example:
Exclusions
Exclusions can be used to block the /search
endpoint from returning information from a given list of sources. It should be used in the format of the example below:
Prioritization
Prioritization can be used to favor some sources. The /search
endpoint will try to find the requested information in the favored sources. If unsuccessful, it will fall back to other sources. Prioritization can be used in tiers.
Examples
The different restrictions can be used together.
Exclusion + Prioritization
Restriction + Prioritization