org.apache.solr.request.SimpleFacets Java Examples

The following examples show how to use org.apache.solr.request.SimpleFacets. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LocalDatasetGraph.java    From SolRDF with Apache License 2.0 5 votes vote down vote up
@Override
public Iterator<Node> listGraphNodes() {
    final SolrIndexSearcher.QueryResult result = new SolrIndexSearcher.QueryResult();
    try {
		request.getSearcher().search(result, GET_GRAPH_NODES_QUERY);
		final SimpleFacets facets = new SimpleFacets(
	    		request, 
	    		result.getDocSet(), 
	    		GET_GRAPH_NODES_QUERY_PARAMS);
		
		final NamedList<Integer> list = facets.getFacetTermEnumCounts(
				request.getSearcher(), 
				result.getDocSet(),
				Field.C,
				0,
				-1,
				1,
				false,
				"count"
				,null,
				null,
				false,
				null);
		final List<Node> graphs = new ArrayList<Node>();
		for (final Entry<String, Integer> entry : list) {
			if (!SolRDFGraph.UNNAMED_GRAPH_PLACEHOLDER.equals(entry.getKey())) {
				graphs.add(NTriples.asURI(entry.getKey()));
			}
		}
		
		LOGGER.debug(MessageCatalog._00112_GRAPHS_TOTAL_COUNT, graphs.size());
		
		return graphs.iterator();
	} catch (final Exception exception) {
		LOGGER.error(MessageCatalog._00113_NWS_FAILURE, exception);
		throw new SolrException(ErrorCode.SERVER_ERROR, exception);
	}	    
}
 
Example #2
Source File: FacetComponent.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
protected SimpleFacets newSimpleFacets(SolrQueryRequest req, DocSet docSet, SolrParams params, ResponseBuilder rb) {
  return new SimpleFacets(req, docSet, params, rb);
}
 
Example #3
Source File: FacetComponent.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
public static NamedList<Object> getFacetCounts(SimpleFacets simpleFacets) {
  return getFacetCounts(simpleFacets, null);
}
 
Example #4
Source File: FacetComponent.java    From lucene-solr with Apache License 2.0 4 votes vote down vote up
private DistribFacetExistsField(ResponseBuilder rb, String facetStr) {
  super(rb, facetStr);
  SimpleFacets.checkMincountOnExists(field, minCount); 
}