cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS + Solr + Highlighting

swanands
Champ in-the-making
Champ in-the-making
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-highlig...">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-21...
">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
3 REPLIES 3

jpfi
Champ in-the-making
Champ in-the-making
Hi,
as far as I know default SOLR hit highlighting component cannot be used in Alfresco's SOLR. I've tried this in 4.0 & gave up after a few hours.
Maybe it is easier with later Alfresco versions. At least Alfresco Search API doesn't support hit highlighting, so it's gonna be a bigger coding task.
cheers, jan

swanands
Champ in-the-making
Champ in-the-making
Thanks for the reply Jan.
Oh, so in that case what would you suggest as an alternative for my use case? I need to get the highlight working otherwise have to think of a different crazy way to do it like getting the content out of Alfresco & putting only the required content on to the server and having Solr index that for enabling the highlighting (I don't know how I will do this also though, need to check) of content.

andy
Champ on-the-rise
Champ on-the-rise
Hi

Even if we supported this in the product the CMIS API does not cover highlighting.
It is something to suggest.

If you mark properties as stored in the dictionary you can use highlighting as shipped with SOLR but it would not be exposed in the Alfresco search and you would have to go to SOLR direct.

Andy