From reading the documentation and observing the XHR requests in the browser it looks like I need the following things for the request to work:
- In the POST body an aq key and @syssource value to identify the index to use
- A way of constructing the Coveo field name
- Possibly a way of constructing my query, however I believe I might be able to hand roll it myself
I guess that you are using Coveo for Sitecore since you talk about field name translation and finding the syssource field value to use to target a specific Sitecore index.
The translation of Sitecore field names to Coveo field names is done on the server side while the search page is rendered. The
BaseModel class contains two
ToCoveoFieldName methods that calls similar methods on an instance of the
IFieldHelper interface (
FieldHelper class). This class can help you to implement field translation in your custom solution.
To identify the right syssource field value to use, Coveo for Sitecore uses the Sitecore context database, finds the first Sitecore index (managed by Coveo) that indexes this database and get its
SourceName. All that is done by the
SitecoreHelper.GetSearchIndex(IIndexable) method on the server side again. The
IIndexable object to pass to the method must be the Sitecore context current item.
I hope this helps you to bake your own search UI framework
The REST API used by the JS UI is documented here: https://developers.coveo.com/display/SearchREST/Invoking+the+REST+Search+API
You do not need to specify a source, by default the whole index is queried (with proper security applied, of course). The most often use arguments are
q for passing the user entered query,
aq for the "advanced" part (typically filters and so on), etc.