Package org.apache.lucene.demo.facet
Class CustomFacetSetExample
- java.lang.Object
-
- org.apache.lucene.demo.facet.CustomFacetSetExample
-
public class CustomFacetSetExample extends Object
Shows usage of indexing and searchingFacetSetsFieldwith a customFacetSetimplementation. Unlike the out of the boxFacetSetimplementations, this example shows how to mix and match dimensions of different types, as well as implementing a customFacetSetMatcher.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCustomFacetSetExample.TemperatureOnlyFacetSetMatcherAFacetSetMatcherwhich matches facet sets only by their temperature dimension, ignoring the date.static classCustomFacetSetExample.TemperatureReadingFacetSetAFacetSetwhich encodes a temperature reading in a date (long) and degrees (celsius; float).
-
Constructor Summary
Constructors Constructor Description CustomFacetSetExample()Empty constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidmain(String[] args)Runs the search and drill-down examples and prints the results.FacetResultrunCustomRangeMatching()Runs the custom range matching example.FacetResultrunExactMatching()Runs the exact matching example.FacetResultrunExactMatchingWithFastMatchQuery()Runs the exact matching with fast match query example.FacetResultrunRangeMatching()Runs the range matching example.
-
-
-
Constructor Detail
-
CustomFacetSetExample
public CustomFacetSetExample()
Empty constructor
-
-
Method Detail
-
runExactMatching
public FacetResult runExactMatching() throws IOException
Runs the exact matching example.- Throws:
IOException
-
runExactMatchingWithFastMatchQuery
public FacetResult runExactMatchingWithFastMatchQuery() throws IOException
Runs the exact matching with fast match query example.- Throws:
IOException
-
runRangeMatching
public FacetResult runRangeMatching() throws IOException
Runs the range matching example.- Throws:
IOException
-
runCustomRangeMatching
public FacetResult runCustomRangeMatching() throws IOException
Runs the custom range matching example.- Throws:
IOException
-
-