Fork me on GitHub
  • API

    Namespace Lucene.Net.Facet

    Provides faceted indexing and search capabilities. Checkout this and this blog posts for some overview on the facets module as well as source code examples here.

    Classes

    DrillDownQuery

    A Lucene.Net.Search.Query for drill-down over facet categories. You should call Add(string, params string[]) for every group of categories you want to drill-down over.

    NOTE: if you choose to create your own Lucene.Net.Search.Query by calling Term(string, string, params string[]), it is recommended to wrap it with Lucene.Net.Search.ConstantScoreQuery and set the boost to 0.0f, so that it does not affect the scores of the documents.

    Collection initializer note: To create and populate a DrillDownQuery in a single statement, you can use the following example as a guide:
    var drillDownQuery = new DrillDownQuery(config)
    {
        { "Publish Date", "2019" },
        { "Publish Date", "2020" },
        { "Publish Date", "2021" },
        { "timestamp", NumericRangeQuery.NewInt64Range("timestamp", range.Min, range.Max, range.MinInclusive, range.MaxInclusive) },
        { "filter", GetFilter() }
    };

    Note

    This API is experimental and might change in incompatible ways in the next release.

    DrillSideways

    Computes drill down and sideways counts for the provided DrillDownQuery. Drill sideways counts include alternative values/aggregates for the drill-down dimensions so that a dimension does not disappear after the user drills down into it.

    Use one of the static search methods to do the search, and then get the hits and facet results from the returned DrillSidewaysResult.

    NOTE: this allocates one FacetsCollector for each drill-down, plus one. If your index has high number of facet labels then this will multiply your memory usage.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    DrillSidewaysResult

    Result of a drill sideways search, including the Facets and Lucene.Net.Search.TopDocs.

    FacetField

    Add an instance of this to your Lucene.Net.Documents.Document for every facet label.

    NOTE: you must call Build(Document) before you add the document to Lucene.Net.Index.IndexWriter.

    FacetResult

    Counts or aggregates for a single dimension.

    Facets

    Common base class for all facets implementations.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    FacetsCollector

    Collects hits for subsequent faceting. Once you've run a search and collect hits into this, instantiate one of the Lucene.Net.Search.ICollector subclasses to do the facet counting. Use the Search utility methods (such as Search(IndexSearcher, Query, int, ICollector)) to perform an "ordinary" search but also collect into a Facets.

    FacetsCollector.Docs

    Used during collection to record matching docs and then return a DocIdSet that contains them.

    FacetsCollector.MatchingDocs

    Holds the documents that were matched in the Lucene.Net.Index.AtomicReaderContext. If scores were required, then Scores is not null.

    FacetsConfig

    Records per-dimension configuration. By default a dimension is flat, single valued and does not require count for the dimension; use the setters in this class to change these settings for each dim.

    NOTE: this configuration is not saved into the index, but it's vital, and up to the application to ensure, that at search time the provided FacetsConfig matches what was used during indexing.

    Note

    This API is experimental and might change in incompatible ways in the next release.

    FacetsConfig.DimConfig

    Holds the configuration for one dimension

    Note

    This API is experimental and might change in incompatible ways in the next release.

    LabelAndValue

    Single label and its value, usually contained in a FacetResult.

    MultiFacets

    Maps specified dims to provided Facets impls; else, uses the default Facets impl.

    RandomSamplingFacetsCollector

    Collects hits for subsequent faceting, using sampling if needed. Once you've run a search and collect hits into this, instantiate one of the Facets subclasses to do the facet counting. Note that this collector does not collect the scores of matching docs (i.e. Scores) is null.

    If you require the original set of hits, you can call GetOriginalMatchingDocs(). Also, since the counts of the top-facets is based on the sampled set, you can amortize the counts by calling AmortizeFacetCounts(FacetResult, FacetsConfig, IndexSearcher).

    TopOrdAndInt32Comparer

    Keeps highest results, first by largest int value, then tie break by smallest ord.

    NOTE: This is a refactoring of TopOrdAndIntQueue in Lucene

    TopOrdAndInt32Queue

    Keeps highest results, first by largest int value, then tie break by smallest ord.

    NOTE: This was TopOrdAndIntQueue in Lucene

    TopOrdAndSingleComparer

    Keeps highest results, first by largest float value, then tie break by smallest ord.

    NOTE: This is a refactoring of TopOrdAndFloatQueue in Lucene

    TopOrdAndSingleQueue

    Keeps highest results, first by largest float value, then tie break by smallest ord.

    NOTE: This was TopOrdAndFloatQueue in Lucene

    Structs

    OrdAndValue<T>

    Holds a single entry.

    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.