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 2012 Apigee Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/
package org.usergrid.utils;
import static org.usergrid.utils.ClassUtils.cast;
import static org.usergrid.utils.ClassUtils.isBasicType;
import static org.usergrid.utils.JsonUtils.quoteString;
import static org.usergrid.utils.JsonUtils.toJsonNode;
import java.io.IOException;
import java.io.StringReader;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.UUID;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.analysis.tokenattributes.TermAttribute;
import org.apache.lucene.util.Version;
import org.codehaus.jackson.JsonNode;
import org.codehaus.jackson.node.ArrayNode;
import org.codehaus.jackson.node.ObjectNode;
public class IndexUtils {
private static final Logger logger = LoggerFactory.getLogger(IndexUtils.class);
static Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_30);
private static void buildKeyValueSet(Object node,
Map> keyValues, String path,
boolean fulltextIndex, Object... history) {
if (node == null) {
return;
}
if (node instanceof Collection) {
Object[] new_history = Arrays.copyOf(history, history.length + 1);
new_history[history.length] = node;
@SuppressWarnings("unchecked")
Collection