org.elasticsearch.search.facet.FacetBuilders Java Examples

The following examples show how to use org.elasticsearch.search.facet.FacetBuilders. 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: ShellScope.java    From elasticshell with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new <code>ShellScope</code> given the actual scope object
 * @param scope the actual scope object that depends on the engine in use
 */
ShellScope(Scope scope, ResourceRegistry resourceRegistry) {
    this.scope = scope;
    this.resourceRegistry = resourceRegistry;
    registerJavaClass(Requests.class);
    registerJavaClass(SearchSourceBuilder.class);
    registerJavaClass(QueryBuilders.class);
    registerJavaClass(FilterBuilders.class);
    registerJavaClass(SortBuilders.class);
    registerJavaClass(FacetBuilders.class);
    registerJavaClass(RescoreBuilder.class);
    registerJavaClass(SuggestBuilder.class);
    registerJavaClass(AliasAction.class);
    registerJavaClass(HttpParameters.class);
    registerJavaClass(AllocateAllocationCommand.class);
    registerJavaClass(CancelAllocationCommand.class);
    registerJavaClass(MoveAllocationCommand.class);
    registerJavaClass(ShardId.class);
}
 
Example #2
Source File: ProductQueryServiceImpl.java    From elasticsearch-tutorial with MIT License 5 votes vote down vote up
private RangeFacetBuilder getPriceRangeFacet(String facetCode)
{
    return FacetBuilders.rangeFacet(facetCode)
                                        .field(SearchDocumentFieldName.PRICE.getFieldName())
                                        .addRange(0, 10)
                                        .addRange(10, 20)
                                        .addRange(20, 100);
}
 
Example #3
Source File: ProductQueryServiceImpl.java    From searchanalytics-bigdata with MIT License 4 votes vote down vote up
private RangeFacetBuilder getPriceRangeFacet(final String facetCode) {
	return FacetBuilders.rangeFacet(facetCode)
			.field(SearchDocumentFieldName.PRICE.getFieldName())
			.addRange(0, 10).addRange(10, 20).addRange(20, 100);
}