AnsweredAssumed Answered

Search faceting and highlighting

Question asked by alex_chew on Jul 29, 2012
Latest reply on Aug 5, 2012 by arnoldschrijver

I am trying to implement search faceting and highlighting within Alfresco Share.  My initial thoughts are,
1, switch search to solr sub-system which can enable faceting (there has API to add facet fields to SearchParameters before starting searchService.query() method)
2, because the content must be stored in index, I can add an customized field MYCONTENT to index. This can be archived by customizing ADMLuceneIndexerImpl and AVMLuceneIndexerImpl
3, I can access SOLR instance via solrj APIs. Here I can control almost anything like hightling , faceting or filtering.
4, I also can customize the scriptable Search (org.alfresco.repo.jscript.Search) to call my search method which has implemented in step 3
5, I can add highlighting and faceting results to response JSON data. this can be done by customizing search.get.json.ftl
6, If everything goes ok, I can add the returned facets and highlighting results to the web page by customizing search.get.html.ftl and search.js

I spent 4+ days on this and tried some tests. But I didn't get the result I want yet. here are the problems I got,
1, I added a multi-valued MYCONTENT field to the index but I cannot see it while checking solr index schema
2, I cannot get any result when I switched to SOLR sub-system. But when search using lucene sub-system I can get results from Datalist, WIKI page, documents etc.
3, I also cannot get any result from solrj APIs. And there has no NODEREF field in the index so I have to find a way to build NodeRef from raw index record. It seems not easy. Or I have to store the NODEREF to index directly

Does anyone have experience to do implement this kind of features? Any suggestions will be appreciated.
My Alfresco version is 4.0.c CE.