cancel
Showing results for 
Search instead for 
Did you mean: 

SOLR and FACET

filterse
Champ in-the-making
Champ in-the-making
Dear All,
we I am trying to obtain facets from SOLR from Alfresco (4.0) . We are using the SearchService and when we build the query we add something like:

         SearchParameters mysp = searchParameters.copy();
                         ….
         String fadetField="my:experienceTag";
         FieldFacet fieldFacet = new FieldFacet(fadetField);
         mysp.addFieldFacet(fieldFacet );
No other parameter is changed to the copy of a standard query coming from the advanced search interface. The query itself looks like:

"query":"((TYPE:\"my:experience\" AND (my:experienceTag:\"applications\")) AND -TYPE:\"cm:thumbnail\" AND -TYPE:\"cm:failedThumbnail\" AND -TYPE:\"cm:rating\") AND NOT ASPECT:\"sys:hidden\""
and return six documents. However I was unable to retrieve facets, which is always empty. The request entity before for the POST method is:

/solr/alfresco/afts?q=%28%28TYPE%3A%22my%3Aexperience%22+AND+%28my%3AexperienceTag%3A%22applications%22%29%29+AND+-TYPE%3A%22cm%3Athumbnail%22+AND+-TYPE%3A%22cm%3AfailedThumbnail%22+AND+-TYPE%3A%22cm%3Arating%22%29+AND+NOT+ASPECT%3A%22sys%3Ahidden%22&wt=json&fl=*%2Cscore&rows=502&df=keywords&start=0&locale=en_US&fq=%7B%21afts%7DAUTHORITY_FILTER_FROM_JSON&fq=%7B%21afts%7DTENANT_FILTER_FROM_JSON&facet=true&facet.field=my%3AexperienceTag&f.my%3AexperienceTag.facet.limit=100

and the json response:

{"response":{"start":0,"docs":[{"INTXID":["1046"],"score":10.928302,"ID":["LEAF-3266"],"ASPECT":["{http://www.alfresco.org/model/system/1.0}localized','{http://www.alfresco.org/model/content/1.0}audi...":[]}}}
Any idea on that? Anybody ever used facets from the search service successfully?
Many Thanks,

Guido
10 REPLIES 10

swatnew1
Champ on-the-rise
Champ on-the-rise
Hello ,

Can Solr facet be used in Alfresco 4 for improving search performance ?
If yes ,then please post example of Solr facet configuration for alfresco content model / example using api  .