org.hibernate.search.indexes.serialization.spi.LuceneNumericFieldContext Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-search-engine Show documentation
Show all versions of hibernate-search-engine Show documentation
Core of the Object/Lucene mapper, query engine and index management
/*
* Hibernate Search, full-text search for your domain model
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.search.indexes.serialization.spi;
import org.apache.lucene.document.FieldType;
import org.apache.lucene.index.IndexOptions;
/**
* @author Emmanuel Bernard
* @author Sanne Grinovero
*/
public class LuceneNumericFieldContext {
private final FieldType field;
private final String fieldName;
private final float fieldBoost;
public LuceneNumericFieldContext(FieldType field, String fieldName, float fieldBoost) {
this.field = field;
this.fieldName = fieldName;
this.fieldBoost = fieldBoost;
}
public String getName() {
return fieldName;
}
public int getPrecisionStep() {
return field.numericPrecisionStep();
}
public SerializableStore getStore() {
return field.stored() ? SerializableStore.YES : SerializableStore.NO;
}
public boolean isIndexed() {
return field.indexOptions() != IndexOptions.NONE;
}
public float getBoost() {
return fieldBoost;
}
public boolean getOmitNorms() {
return field.omitNorms();
}
public boolean getOmitTermFreqAndPositions() {
return field.indexOptions() == IndexOptions.DOCS;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy