1 package org.apache.lucene.facet.index.categorypolicy;
3 import org.apache.lucene.facet.taxonomy.TaxonomyReader;
4 import org.apache.lucene.facet.taxonomy.TaxonomyWriter;
7 * Licensed to the Apache Software Foundation (ASF) under one or more
8 * contributor license agreements. See the NOTICE file distributed with
9 * this work for additional information regarding copyright ownership.
10 * The ASF licenses this file to You under the Apache License, Version 2.0
11 * (the "License"); you may not use this file except in compliance with
12 * the License. You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 * This class filters our the ROOT category ID. For more information see
25 * {@link OrdinalPolicy}.
27 * @lucene.experimental
29 public class DefaultOrdinalPolicy implements OrdinalPolicy {
32 * Filters out (returns false) ordinals equal or less than
33 * {@link TaxonomyReader#ROOT_ORDINAL}. true otherwise.
35 public boolean shouldAdd(int ordinal) {
36 return ordinal > TaxonomyReader.ROOT_ORDINAL;
40 * Implemented as NO-OP as the default is not taxonomy dependent
42 public void init(TaxonomyWriter taxonomyWriter) { }