Alfresco can be used to store documents. I am trying to fetch list of matching indexes.
For example " sainik, sainik welfare, sainik department etc., " exists in these documents. Now, How will I get the list of all words / sentences that begin with sainik? Please note that I am not looking for documents that contain the word sainik? I am looking for list of all words that begin across all the documents in the repositories?
How can I achieve the above requirement with Alfresco rest api ? or with with extensions?
Not sure about your requirement.
So you want to perform a Query and to get a list of sentences from the content of the document that starts with "sainik"?
This is not available out of the box, as SOLR returns the whole document that matches your search criteria.
Probably you have to inspect all these results and to extract the sentence you are looking for.
If it's not out of box, how is it being implemented by Alfresco Share application . if you go to the top right most corner in alfresco share application, after login, there is a search box available. If you type in sainik then shows all the sentences or words that start with sainik. How is this done?
Nice catch! I didn't remember about that.
You can use SOLR Suggester Service, what finds shingles for a term.
You can perform tests at SOLR Web Console to guess if it was you were looking for.
For instance, following SOLR request...
http://localhost/solr/alfresco/suggest?indent=on&q=video&wt=json
... returns results starting with "video" in this way
{
"responseHeader":{
"status":0,
"QTime":0},
"suggest":{"shingleBasedSuggestions":{
"video":{
"numFound":10,
"suggestions":[{
"term":"video",
"weight":4,
"payload":""},
{
"term":"video provides",
"weight":2,
"payload":""},
{
"term":"video provides a",
"weight":2,
"payload":""},
{
"term":"video that",
"weight":2,
"payload":""},
{
"term":"video that best",
"weight":2,
"payload":""},
{
"term":"video you",
"weight":2,
"payload":""},
{
"term":"video you can",
"weight":2,
"payload":""},
{
"term":"video you want",
"weight":2,
"payload":""},
{
"term":"video files",
"weight":1,
"payload":""},
{
"term":"video files related",
"weight":1,
"payload":""}]}}}}
Thanks a lot Angel Borroy. I have been looking for this solution for close to a month. It's not mentioned any where in the documents . I posted it few times in our forum also. You are a rock star. i will give you a treat in case you are coming to India.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.