zhouxu created OAK-8770:
---------------------------

             Summary: Can't get fectresult
                 Key: OAK-8770
                 URL: https://issues.apache.org/jira/browse/OAK-8770
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: 1.14
    Affects Versions: 1.14.0
            Reporter: zhouxu


Hello expert!

    I cannot get FectResult with solr,my code as follow,I debug the  
"org.apache.jackrabbit.oak.plugins.index.solr.query.SolrQueryIndex",i can get 
the returned fect result from solr response(queryResponse.getFacetFields()).
    1.get fectresult code:
    String sql = "select [jcr:path] ,[jcr:primaryType] ,   
[rep:facet(jcr:primaryType)],id,da_string,da_long,da_date,da_boolean,da_double 
from da_document where contains([jcr:primaryType],'da_document')  order by 
da_long asc";

    Query q = qm.createQuery(sql2, Query.JCR_SQL2);
    QueryResult result = q.execute();
    FacetResult facetResult = new FacetResult(result);
    Set<String> dimensions = facetResult.getDimensions(); // \{ "tags" }
    List<FacetResult.Facet> facets = facetResult.getFacets("tags");
    for (FacetResult.Facet facet : facets) \{
    String label = facet.getLabel();
    int count = facet.getCount();
    }

    2.SolrQueryIndex code:
    List<FacetField> returnedFieldFacet = queryResponse.getFacetFields();



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to