org.eobjects.datacleaner.lucene.WriteSearchIndexAction Maven / Gradle / Ivy
Go to download
An extension for allowing lucene-based search and index-creation in DataCleaner batch jobs.
/**
* DataCleaner (community edition)
* Copyright (C) 2013 Human Inference
*
* This copyrighted material is made available to anyone wishing to use, modify,
* copy, or redistribute it subject to the terms and conditions of the GNU
* Lesser General Public License, as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this distribution; if not, write to:
* Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor
* Boston, MA 02110-1301 USA
*/
package org.eobjects.datacleaner.lucene;
import java.util.Iterator;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.StringField;
import org.apache.lucene.document.TextField;
import org.apache.lucene.index.IndexWriter;
import org.eobjects.metamodel.util.Action;
/**
* Action performed for each batch of records to be inserted into a Lucene
* {@link SearchIndex}.
*/
final class WriteSearchIndexAction implements Action> {
private final SearchIndex _searchIndex;
private final String[] _fields;
public WriteSearchIndexAction(SearchIndex searchIndex, String[] fields) {
_searchIndex = searchIndex;
_fields = fields;
}
@Override
public void run(final Iterable
© 2015 - 2024 Weber Informatics LLC | Privacy Policy