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 searchingFacetSetsField
with a customFacetSet
implementation. Unlike the out of the boxFacetSet
implementations, 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 class
CustomFacetSetExample.TemperatureOnlyFacetSetMatcher
AFacetSetMatcher
which matches facet sets only by their temperature dimension, ignoring the date.static class
CustomFacetSetExample.TemperatureReadingFacetSet
AFacetSet
which 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 void
main(String[] args)
Runs the search and drill-down examples and prints the results.FacetResult
runCustomRangeMatching()
Runs the custom range matching example.FacetResult
runExactMatching()
Runs the exact matching example.FacetResult
runRangeMatching()
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
-
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
-
-