All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hibernate.search.bridge.FieldBridge Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
/*
 * 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.bridge;

import org.apache.lucene.document.Document;

/**
 * Link between a java property and a Lucene Document
 * Usually a Java property will be linked to a Document Field.
 * 

* All implementations need to be threadsafe. * * @author Emmanuel Bernard */ public interface FieldBridge { /** * Manipulate the document to index the given value. *

* A common implementation is to add a Field with the given {@code name} to {@code document} following * the parameters {@code luceneOptions} if the {@code value} is not {@code null}. * * {code} * String fieldValue = convertToString(value); * luceneOptions.addFieldToDocument(name, fieldValue, document); * {code} * * @param name The field to add to the Lucene document * @param value The actual value to index * @param document The Lucene document into which we want to index the value. * @param luceneOptions Contains the parameters used for adding {@code value} to * the Lucene document. */ void set(String name, Object value, Document document, LuceneOptions luceneOptions); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy