My objective is to implement typeahead search against a range index, within the result set defined by another structured query (my main search query). The use case is to search for available facet values (and frequencies) based on existing search results.
I thought the POST /v1/values/{name} API would be a good fit but I have some confusion on how it works.
https://docs.marklogic.com/REST/POST/v1/values/[name]
According to the documentation, this API supports URL parameter q defined as:
A string query. For details, see Automatic Query Text Parsing and Grammar in the Search Developer's Guide. This query is AND'd with the query(s) in the request body.
I may have misunderstood and thought this q would search within the range index, similar to cts:value-match. Apparently it is a regular string query searching the entire document by default?
Is it possible to use /v1/values/{name} for my use case, or this is not what it is designed for? Could you please point me to the right direction? Thanks!