AnsweredAssumed Answered

SOLR and FACET

Question asked by filterse on Mar 19, 2012
Latest reply on Jun 22, 2013 by swatnew1
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}auditable','{http://www.alfresco.org/model/system/1.0}referenceable','{http://www.alfresco.org/model/content/1.0}titled','{http://www.alfresco.org/model/rendition/1.0}renditioned'],'TYPE':['{fr.celi.cv}experience'],'ISNODE':['T'],'DBID':['3266']},{'INTXID':['1050'],'score':8.722575,'ID':['LEAF-3259'],'ASPECT':['{http://www.alfresco.org/model/system/1.0}localized','{http://www.alfresco.org/model/content/1.0}auditable','{http://www.alfresco.org/model/system/1.0}referenceable','{http://www.alfresco.org/model/content/1.0}titled','{http://www.alfresco.org/model/rendition/1.0}renditioned'],'TYPE':['{fr.celi.cv}experience'],'ISNODE':['T'],'DBID':['3259']},{'INTXID':['1051'],'score':7.657556,'ID':['LEAF-3267'],'ASPECT':['{http://www.alfresco.org/model/system/1.0}localized','{http://www.alfresco.org/model/content/1.0}auditable','{http://www.alfresco.org/model/system/1.0}referenceable','{http://www.alfresco.org/model/content/1.0}titled','{http://www.alfresco.org/model/rendition/1.0}renditioned'],'TYPE':['{fr.celi.cv}experience'],'ISNODE':['T'],'DBID':['3267']},{'INTXID':['1048'],'score':7.086814,'ID':['LEAF-3261'],'ASPECT':['{http://www.alfresco.org/model/system/1.0}localized','{http://www.alfresco.org/model/content/1.0}auditable','{http://www.alfresco.org/model/system/1.0}referenceable','{http://www.alfresco.org/model/content/1.0}titled','{http://www.alfresco.org/model/rendition/1.0}renditioned'],'TYPE':['{fr.celi.cv}experience'],'ISNODE':['T'],'DBID':['3261']},{'INTXID':['1049'],'score':5.527518,'ID':['LEAF-3262'],'ASPECT':['{http://www.alfresco.org/model/system/1.0}localized','{http://www.alfresco.org/model/content/1.0}auditable','{http://www.alfresco.org/model/system/1.0}referenceable','{http://www.alfresco.org/model/content/1.0}titled','{http://www.alfresco.org/model/rendition/1.0}renditioned'],'TYPE':['{fr.celi.cv}experience'],'ISNODE':['T'],'DBID':['3262']},{'INTXID':['1047'],'score':5.527518,'ID':['LEAF-3268'],'ASPECT':['{http://www.alfresco.org/model/system/1.0}localized','{http://www.alfresco.org/model/content/1.0}auditable','{http://www.alfresco.org/model/system/1.0}referenceable','{http://www.alfresco.org/model/content/1.0}titled','{http://www.alfresco.org/model/rendition/1.0}renditioned'],'TYPE':['{fr.celi.cv}experience'],'ISNODE':['T'],'DBID':['3268']}],'maxScore':10.928302,'numFound':6},'responseHeader':{'status':0,'QTime':10},'facet_counts':{'facet_queries':{},'facet_dates':{},'facet_fields':{'my:experienceTag":[]}}}
Any idea on that? Anybody ever used facets from the search service successfully?
Many Thanks,

Guido

Outcomes