Datasource Filters
Apart from the general filters we’ve discussed, some filters are specific to one datasource- for example, Confluence has the author
facet, and Slack has the channel
facet. There are also custom facets that are defined for custom datasources pushed via api.
To uncover these datasource-specific facets, you can use our Glean UI to filter by the datasource you’re curious about. You will be able to find a list of facets for your search results, and facet values on the sidebar of the Glean UI (see image below).
Getting possible facets via Search API
If you would like to curl to get the facets, you can use a /search request to get the values that we use to populate the sidebar with a request like this:
This will return a top-level field, facetResults
facetResults has the following relevant fields:
sourceName
- same as the facetfieldName
in thefacetFilter
s objectoperatorName
- not relevantbuckets
- a list of facet bucket objects corresponding to a facet value- The facet bucket object has the following relevant fields:
count
- the number of search results that would be returned if filtering by the facet valuevalue
- the facet value (ie “engineering” for the space facet)stringValue
- the string valueintValue
- the integer value (not common)displayLabel
- alternative value used for display in the UIiconConfig
- optional image used to represent the facet value, such as a profile picture for people facet values.
- The facet bucket object has the following relevant fields:
To get all of the facets you can use with a particular datasource, you can look at all of the sourceName
s in the facetsResult
s returned.
If latency is a concern, and you only want to receive facetResults
, you can send a request with pageSize
= 0, and add “FACET_RESULTS” within the responseHints
field in requestOptions
to not retrieve any documents and only retrieve facetResults. See sample request body below, which would gather facetResults
for all confluence specific facets:
Was this page helpful?