AnsweredAssumed Answered

Returning search context through API

Question asked by tf_bds on Mar 23, 2017
Latest reply on Apr 27, 2017 by tf_bds

Hi,

 

I'm trying to use the REST API to run a search query on the files in Alfresco. I am able to replicate the results from the online interface, but would like to recieve the search term in it's context, as can be seen in the web interface results.

 

For example, when I search for "MacDougall" in the web interface, I get:

And using the API I submit:

http://127.0.0.1:8080/alfresco/service/api/search/keyword.rss?q=MacDougall&p={startPage?}&c={count?}&l={language?} 

 

And get back:

 

<item>
<title>captmidn.txt</title>
<link>http://127.0.0.1:8080/alfresco/service/api/node/content/workspace/SpacesStore/e8758538-7b3a-47fa-8941-d812c01c1b0d/captmidn.txt</link>
<description></description>
<pubDate>2017-03-23T11:59:41.093Z</pubDate>
<guid isPermaLink="false">e8758538-7b3a-47fa-8941-d812c01c1b0d</guid>
</item>

 

As you can see, the correct result is returned, but is missing the keyword MacDougall in it's context as per the browser search.

 

Is there any way in which the API can return the string "It started out as just another Saturday. April 26, 1986. John R. MacDougall, 25, spent the day..."  along with the search result?

 

Many thanks

Outcomes