Best way to get a document from a Coveo Index (C#)
I am creating a notification service in C# that, at a high-level, will get a document id from a database for which I need to say "Hey Coveo, what is the sysdate (last updated date) of the document that has this document id".
Our custom coveo search and subscription code so far has leveraged the Coveo JS Framework v1 (REST services). My notification service is really just all server-side and I wanted to know the best way to get an index entry (document) out of Coveo from C# server side code.
I could make my server make a RESTful call to the Coveo JS Framework but didn't want to jump through that extra hoop if there is a simple C# Coveo API where I can just do something like:
var indexItem = Coveo.GetDocument(indexCollection, documentId)
Thanks for the feedback / direction, ~james
If the document id you describe is a Coveo index document id, you can use the
LoadDocument method of the Coveo Search Service to get that document from the index (see LoadDocument method).
If your document id is not a Coveo index document id and is stored in a field on your Coveo documents, you'll need to query the index with the usual query syntax to find your document.
Instead of calling the REST Endpoint of the Coveo Search API, you could call the Coveo Search Service directly in your code. There is a documentation page that describes how to setup a Visual Studio project to call this service: https://developers.coveo.com/display/SearchSOAP/Getting+Started+Using+the+Coveo+Search+SOAP+API
For the query to execute, I think you managed to find one that matches only the desired document in your RESTful implementation. You would use the same query.
If you need anything else, don't hesitate.