AnsweredAssumed Answered

CMIS + Solr + Highlighting

Question asked by swanands on Feb 25, 2013
Latest reply on Feb 26, 2013 by swanands
Hi,

I have a peculiar requirement where I need to <strong> Search by using OpenCMIS and highlight the Search Hits</strong>:

1. Get all the documents (in my case HTMLs) where a certain keyword occurs (done using Open CMIS queries, able to get the resultset using CONTAINS)

2. Generate the list of results in the following structure (<a href="https://lh5.googleusercontent.com/-PenU1L-EQoA/TYg0h42REuI/AAAAAAAAABM/2H3uZtpsrbU/s1600/alf-highlight.png">Something like this</a>):-
    -File Name
    -Small fragment from the HTML file where search key is present <blockquote>(Able to get the file names and loop them to generate the list but not able to fetch the fragment)</blockquote>

3.On clicking on the above fragment or the file name, navigate the user to the corresponding HTML page and highlight the Search Key in it<blockquote> (Cannot product a link for that file name which will open that HTML in the browser. Highlighting is the next step after this) </blockquote>

I have gone through lot of <a href="https://forums.alfresco.com/forum/developer-discussions/add-ons/highlighting-query-terms-12062009-2117
">threads</a> regarding the Search but couldn't find the answer for generating the link for HTML and highlighting the searched word in it.



Do I have to use <a href="http://lucene.apache.org/core/old_versioned_docs/versions/3_0_0/lucene-contrib/index.html"><strong>Lucene Contrib</strong> </a> for Highlighting or does it come out of the box with Solr_Alfresco 4+?

<a href="http://aymen-s.blogspot.in/2011/03/implementing-search-hits-highlight-in.html">This blog</a> was very useful but it is for Lucene not Solr and older version of Alfresco.

<a href="http://simchaudhary.blogspot.in/">This blog </a>doesn't use Open CMIS for searching & highlighting is not mentioned.




Any kind of help is appreciated,

Thanks,
Swanand

Outcomes