Fernando Volquind
Fernando Volquind

Reputation: 67

Alfresco CMIS: Retrieving relevant context when searching for content

I am using Alfresco Community 201707 x64. My application is querying the repository via CMIS, using Apache Chemistry Open CMIS 1.1.

The question, as the title suggests, is: when querying the repository for document content (using the CONTAINS predicate on the search query), how do I retrieve a document's relevant context? Can I do it using CMIS, or do I have to use a different approach?

For example, in Alfresco Share, when a user searches the repository for documents containing some word, the relevant results are displayed with a snippet of the document's content with said word highlighted.

Upvotes: 0

Views: 176

Answers (2)

Lista
Lista

Reputation: 2246

I do not think this is available in CMIS, it is however generally available if using SOLR, depending on Alfresco version.

http://docs.alfresco.com/5.2/concepts/search-api-highlight.html

Upvotes: 2

Akah
Akah

Reputation: 1920

As said by @Lista,

It is a new feature coming with Alfresco 5.2.1 : http://docs.alfresco.com/5.2/concepts/search-api-highlight.html

You can use it by making a call to the /search endpoint :

The Search API provides access to the search features of Alfresco Content Services.

The Search API accepts POST requests containing JSON structures as described in the table below. The JSON is structured to group options related to different query concepts together.

The Search API is defined under the search namespace. It uses the /search endpoint, which does not accept any URL parameters and is therefore, completely controlled via the parameters in a POST body.

But as far as I know, this is not possible to do it by CMIS. Can you switch the way you are interacting with Alfresco (the REST way) ?

Upvotes: 0

Related Questions