cancel
Showing results for 
Search instead for 
Did you mean: 

Show search results with excerpts (like Google)

nicolasraoul
Star Contributor
Star Contributor
I am dreaming of a search UI that would show a text excerpt for each search result.

Does this already exist in Alfresco?
Or do I have to develop a specific Dialog that would call Lucene?
Or maybe it is not even possible to do this with Lucene?

Thanks a lot!
Nicolas

Note:Because I am searching only text files, showing each matching line would be fine too.
9 REPLIES 9

zaizi
Champ in-the-making
Champ in-the-making
Yes this is doable. We've implemented this for a customer project. You can use Lucene for selecting best text excerpts and display it in Alfresco results.

DM me for details.
Ainga

nicolasraoul
Star Contributor
Star Contributor
I am actually asking this question because someone asked on the Japanese forum, and I did not know the answer so I asked on the English forum. Here is the original message: http://forums.alfresco.com/jp/viewtopic.php?f=4&t=530

Does it require development or is it just configuration/Spring?

Thanks a lot!
Nicolas

zaizi
Champ in-the-making
Champ in-the-making
Yes, it requires development. You can utilise Lucene to provide the hit highlighting functionality. See http://www.cocooncenter.org/articles/lucene.html.

However to enable to Lucene to do that you'll need to extend Alfresco through Java coding. For one Alfresco's lucene index does not store the complete text just the index. The text needs to be stored / generated so they can be displayed in the search results. This would depend on your specific requirements.

Ainga

nicolasraoul
Star Contributor
Star Contributor
Thanks a lot! 🙂

Nicolas

aymens
Champ in-the-making
Champ in-the-making
Hello,

I implemented it for Alfresco CE 3.4.d, wrote something about it and provided an svn patch for that.

If you're interested check this: http://aymen-s.blogspot.com/2011/03/implementing-search-hits-highlight-in.html

Regards,

nicolasraoul
Star Contributor
Star Contributor
Thanks aymens, that looks great!
Nicolas

zaizi
Champ in-the-making
Champ in-the-making
We tried this approach first and then changed it because the Lucene index was growing quite large in production. Instead we created a child association to the content and stored the text version in the repository. Similar to how renditions are stored.

Ainga

aymens
Champ in-the-making
Champ in-the-making
Hi Ainga,

That would require querying node service for each node to get content at LuceneResultSet level.

That may slow down search response time significantly, but if index size becomes too big to put up with, one should choose your solution for content storage.

Thanks,

aymens
Champ in-the-making
Champ in-the-making
Thanks aymens, that looks great!
Nicolas

You're welcome Smiley Happy