Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2012 - 2023 Data In Motion and others.
* All rights reserved.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Data In Motion - initial API and implementation
*/
package org.gecko.search.util;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.function.Predicate;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field.Store;
import org.apache.lucene.document.StringField;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.BasicEObjectImpl;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EcoreUtil;
/**
* {@link Document} helper class
* @author ilenia
* @since Mar 19, 2021
*/
public class DocumentUtil {
/**
* Option to provide a list of EStructuralFeatures that can be ignored for the index
*/
public static final String IGNORE_FEATURE_LIST = "ignore.feature.list";
/**
* Option to specify whether non-containment reference should be index or not.
* If not provided, false will be used as default value.
*/
public static final String INDEX_NON_CONTAINEMENT = "index.non.containment";
public static final SimpleDateFormat SDF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
static
{
SDF.setTimeZone(TimeZone.getTimeZone("UTC"));
}
/** _E_CLASS_URI */
private static final String ECLASS_URI = "_eClassUri";
/** _NULL */
private static final String NULL_VALUE = "_NULL_";
/** _PROXY_URI */
private static final String PROXY_URI = "_proxyUri";
public static void toDocument(Document doc, EObject eObject, Map