1 package org.apache.lucene.facet.index.params;
3 import java.io.Serializable;
5 import org.apache.lucene.facet.index.categorypolicy.OrdinalPolicy;
6 import org.apache.lucene.facet.index.categorypolicy.PathPolicy;
7 import org.apache.lucene.facet.taxonomy.CategoryPath;
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed with
12 * this work for additional information regarding copyright ownership.
13 * The ASF licenses this file to You under the Apache License, Version 2.0
14 * (the "License"); you may not use this file except in compliance with
15 * the License. You may obtain a copy of the License at
17 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
27 * Parameters on how facets are to be written to the index.
28 * For example, which fields and terms are used to refer to the indexed posting list.
30 * If non-default parameters were used during indexing, the same parameters
31 * must also be passed during faceted search. This requirement is analogous
32 * to the requirement during search to know which fields were indexed, and which
33 * Analyzer was used on the text.
35 * @lucene.experimental
37 public interface FacetIndexingParams extends Serializable {
40 * The name of the category-list to put this category in, or null if this
41 * category should not be aggregatable.
43 * By default, all categories are written to the same category list, but
44 * applications which know in advance that in some situations only parts
45 * of the category hierarchy needs to be counted can divide the categories
46 * into two or more different category lists.
48 * If null is returned for a category, it means that this category should
49 * not appear in any category list, and thus counts for it cannot be
50 * aggregated. This category can still be used for drill-down, even though
51 * the count for it is not known.
53 public CategoryListParams getCategoryListParams(CategoryPath category);
56 * Return info about all category lists in the index.
58 * @see #getCategoryListParams(CategoryPath)
60 public Iterable<CategoryListParams> getAllCategoryListParams();
62 // TODO (Facet): Add special cases of exact/non-exact category term-text
65 * Return the drilldown Term-Text which does not need to do any allocations.
66 * The number of chars set is returned.
68 * Note: Make sure <code>buffer</code> is large enough.
69 * @see CategoryPath#charsNeededForFullPath()
71 public int drillDownTermText(CategoryPath path, char[] buffer);
74 * Get the partition size.
75 * Same value should be used during the life time of an index.
76 * At search time this value is compared with actual taxonomy size and their minimum is used.
78 public int getPartitionSize();
81 * Get the policy for indexing category <b>paths</b>,
82 * used for deciding how "high" to climb in taxonomy
83 * from a category when ingesting its category paths.
85 public PathPolicy getPathPolicy();
88 * Get the policy for indexing category <b>ordinals</b>,
89 * used for deciding how "high" to climb in taxonomy
90 * from a category when ingesting its ordinals
92 public OrdinalPolicy getOrdinalPolicy();
95 * Get the delimiter character used internally for drill-down terms
97 public char getFacetDelimChar();