Tabnine Logo
FieldMapper$Builder
Code IndexAdd Tabnine to your IDE (free)

How to use
FieldMapper$Builder
in
org.elasticsearch.index.mapper

Best Java code snippets using org.elasticsearch.index.mapper.FieldMapper$Builder (Showing top 20 results out of 315)

origin: apache/servicemix-bundles

@Override
public Builder docValues(boolean docValues) {
  if (docValues) {
    throw new IllegalArgumentException("[text] fields do not support doc values");
  }
  return super.docValues(docValues);
}
origin: org.elasticsearch/elasticsearch

@Override
protected void setupFieldType(BuilderContext context) {
  super.setupFieldType(context);
  DateFormatter dateTimeFormatter = fieldType().dateTimeFormatter;
  if (fieldType().rangeType == RangeType.DATE) {
    if (!locale.equals(dateTimeFormatter.locale())) {
      fieldType().setDateTimeFormatter(dateTimeFormatter.withLocale(locale));
    }
  } else if (dateTimeFormatter != null) {
    throw new IllegalArgumentException("field [" + name() + "] of type [" + fieldType().rangeType
      + "] should not define a dateTimeFormatter unless it is a " + RangeType.DATE + " type");
  }
}
origin: org.elasticsearch/elasticsearch

  throw new MapperParsingException("no handler for type [" + type + "] declared on field [" + multiFieldName + "]");
builder.addMultiField(typeParser.parse(multiFieldName, multiFieldNodes, parserContext));
multiFieldNodes.remove("type");
DocumentMapperParser.checkNoRemainingFields(propName, multiFieldNodes, parserContext.indexVersionCreated());
origin: harbby/presto-connectors

final Object propNode = entry.getValue();
if (propName.equals("index_name") && indexVersionCreated.before(Version.V_2_0_0_beta1)) {
  builder.indexName(propNode.toString());
  iterator.remove();
} else if (propName.equals("store")) {
  builder.store(parseStore(name, propNode.toString()));
  iterator.remove();
} else if (propName.equals("index")) {
  iterator.remove();
} else if (propName.equals(DOC_VALUES)) {
  builder.docValues(nodeBooleanValue(propNode));
  iterator.remove();
} else if (propName.equals("boost")) {
  builder.boost(nodeFloatValue(propNode));
  iterator.remove();
} else if (propName.equals("omit_norms")) {
  builder.omitNorms(nodeBooleanValue(propNode));
  iterator.remove();
} else if (propName.equals("norms")) {
    final Object propNode2 = entry2.getValue();
    if (propName2.equals("enabled")) {
      builder.omitNorms(!nodeBooleanValue(propNode2));
      propsIterator.remove();
    } else if (propName2.equals(Loading.KEY)) {
      builder.normsLoading(Loading.parse(nodeStringValue(propNode2, null), null));
      propsIterator.remove();
origin: com.strapdata.elasticsearch/elasticsearch

  builder.store(nodeBooleanValue(name, propName, propNode));
  iterator.remove();
} else if (propName.equals("index")) {
  builder.index(parseIndex(name, propNode.toString()));
  iterator.remove();
} else if (propName.equals(DOC_VALUES)) {
  builder.docValues(nodeBooleanValue(name, DOC_VALUES, propNode));
  iterator.remove();
} else if (propName.equals("boost")) {
  builder.boost(nodeFloatValue(propNode));
  iterator.remove();
} else if (parserContext.indexVersionCreated().before(Version.V_5_0_0_alpha1)
  iterator.remove();
} else if (propName.equals("index_options")) {
  builder.indexOptions(nodeIndexOptionValue(propNode));
  iterator.remove();
} else if (propName.equals("include_in_all")) {
    deprecationLogger.deprecated("field [include_in_all] is deprecated, as [_all] is deprecated, " +
            "and will be disallowed in 6.0, use [copy_to] instead.");
    builder.includeInAll(nodeBooleanValue(name, "include_in_all", propNode));
  builder.similarity(similarityProvider);
  iterator.remove();
} else if (propName.equals("fielddata")
  builder.cqlPartialUpdate((boolean)propNode);
  iterator.remove();
origin: harbby/presto-connectors

    Mapper.Builder substitute = typeParser.parse(name, Collections.<String, Object>emptyMap(), parserContext);
    if (substitute instanceof FieldMapper.Builder) {
      mainFieldBuilder = ((FieldMapper.Builder) substitute).index(false);
    } else {
    mainFieldBuilder.addMultiField(field);
  mainFieldBuilder.multiFieldPathType(pathType);
} else if (fields != null) {
  for (Mapper.Builder field : fields) {
    mainFieldBuilder.addMultiField(field);
  mainFieldBuilder.multiFieldPathType(pathType);
origin: apache/servicemix-bundles

  builder.store(nodeBooleanValue(name,"store", propNode.toString(), parserContext));
  iterator.remove();
} else if (propName.equals("index")) {
  builder.index(nodeBooleanValue(name, "index", propNode, parserContext));
  iterator.remove();
} else if (propName.equals(DOC_VALUES)) {
  builder.docValues(nodeBooleanValue(name, DOC_VALUES, propNode, parserContext));
  iterator.remove();
} else if (propName.equals("boost")) {
  builder.boost(nodeFloatValue(propNode));
  iterator.remove();
} else if (parserContext.indexVersionCreated().before(Version.V_5_0_0_alpha1)
  iterator.remove();
} else if (propName.equals("index_options")) {
  if (builder.allowsIndexOptions()) {
    builder.indexOptions(nodeIndexOptionValue(propNode));
  } else {
    DEPRECATION_LOGGER.deprecated(
            "own catch all field.");
  } else {
    builder.includeInAll(nodeBooleanValue(name, "include_in_all", propNode, parserContext));
  builder.similarity(similarityProvider);
  iterator.remove();
} else if (propName.equals("fielddata")
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

  builder.store(nodeBooleanValue(name,"store", propNode.toString(), parserContext));
  iterator.remove();
} else if (propName.equals("index")) {
  builder.index(nodeBooleanValue(name, "index", propNode, parserContext));
  iterator.remove();
} else if (propName.equals(DOC_VALUES)) {
  builder.docValues(nodeBooleanValue(name, DOC_VALUES, propNode, parserContext));
  iterator.remove();
} else if (propName.equals("boost")) {
  builder.boost(nodeFloatValue(propNode));
  iterator.remove();
} else if (parserContext.indexVersionCreated().before(Version.V_5_0_0_alpha1)
  iterator.remove();
} else if (propName.equals("index_options")) {
  if (builder.allowsIndexOptions()) {
    builder.indexOptions(nodeIndexOptionValue(propNode));
  } else {
    DEPRECATION_LOGGER.deprecated(
            "own catch all field.");
  } else {
    builder.includeInAll(nodeBooleanValue(name, "include_in_all", propNode, parserContext));
  builder.similarity(similarityProvider);
  iterator.remove();
} else if (propName.equals("fielddata")
origin: harbby/presto-connectors

private static void parseAnalyzersAndTermVectors(FieldMapper.Builder builder, String name, Map<String, Object> fieldNode, Mapper.TypeParser.ParserContext parserContext) {
  NamedAnalyzer indexAnalyzer = builder.fieldType().indexAnalyzer();
  NamedAnalyzer searchAnalyzer = builder.fieldType().searchAnalyzer();
      iterator.remove();
    } else if (propName.equals("store_term_vectors")) {
      builder.storeTermVectors(nodeBooleanValue(propNode));
      iterator.remove();
    } else if (propName.equals("store_term_vector_offsets")) {
      builder.storeTermVectorOffsets(nodeBooleanValue(propNode));
      iterator.remove();
    } else if (propName.equals("store_term_vector_positions")) {
      builder.storeTermVectorPositions(nodeBooleanValue(propNode));
      iterator.remove();
    } else if (propName.equals("store_term_vector_payloads")) {
      builder.storeTermVectorPayloads(nodeBooleanValue(propNode));
      iterator.remove();
    } else if (propName.equals("analyzer") || // for backcompat, reading old indexes, remove for v3.0
    searchAnalyzer = indexAnalyzer;
  builder.indexAnalyzer(indexAnalyzer);
  builder.searchAnalyzer(searchAnalyzer);
origin: apache/servicemix-bundles

  throw new MapperParsingException("no handler for type [" + type + "] declared on field [" + multiFieldName + "]");
builder.addMultiField(typeParser.parse(multiFieldName, multiFieldNodes, parserContext));
multiFieldNodes.remove("type");
DocumentMapperParser.checkNoRemainingFields(propName, multiFieldNodes, parserContext.indexVersionCreated());
origin: harbby/presto-connectors

public static boolean parseMultiField(FieldMapper.Builder builder, String name, Mapper.TypeParser.ParserContext parserContext, String propName, Object propNode) {
  parserContext = parserContext.createMultiFieldContext(parserContext);
  if (propName.equals("path") && parserContext.indexVersionCreated().before(Version.V_2_0_0_beta1)) {
    builder.multiFieldPathType(parsePathType(name, propNode.toString()));
    return true;
  } else if (propName.equals("fields")) {
        throw new MapperParsingException("no handler for type [" + type + "] declared on field [" + multiFieldName + "]");
      builder.addMultiField(typeParser.parse(multiFieldName, multiFieldNodes, parserContext));
      multiFieldNodes.remove("type");
      DocumentMapperParser.checkNoRemainingFields(propName, multiFieldNodes, parserContext.indexVersionCreated());
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

  throw new MapperParsingException("no handler for type [" + type + "] declared on field [" + multiFieldName + "]");
builder.addMultiField(typeParser.parse(multiFieldName, multiFieldNodes, parserContext));
multiFieldNodes.remove("type");
DocumentMapperParser.checkNoRemainingFields(propName, multiFieldNodes, parserContext.indexVersionCreated());
origin: com.strapdata.elasticsearch/elasticsearch

  throw new MapperParsingException("no handler for type [" + type + "] declared on field [" + multiFieldName + "]");
builder.addMultiField(typeParser.parse(multiFieldName, multiFieldNodes, parserContext));
multiFieldNodes.remove("type");
DocumentMapperParser.checkNoRemainingFields(propName, multiFieldNodes, parserContext.indexVersionCreated());
origin: com.strapdata.elasticsearch/elasticsearch

    lonMapperBuilder.precisionStep(precisionStep);
  latMapper = (LegacyDoubleFieldMapper) latMapperBuilder.includeInAll(false).store(fieldType.stored()).docValues(false).build(context);
  lonMapper = (LegacyDoubleFieldMapper) lonMapperBuilder.includeInAll(false).store(fieldType.stored()).docValues(false).build(context);
} else {
  latMapper = new NumberFieldMapper.Builder(Names.LAT, NumberFieldMapper.NumberType.DOUBLE)
origin: harbby/presto-connectors

  lonMapperBuilder.precisionStep(precisionStep);
latMapper = (DoubleFieldMapper) latMapperBuilder.includeInAll(false).store(fieldType.stored()).docValues(false).build(context);
lonMapper = (DoubleFieldMapper) lonMapperBuilder.includeInAll(false).store(fieldType.stored()).docValues(false).build(context);
geoPointFieldType.setLatLonEnabled(latMapper.fieldType(), lonMapper.fieldType());
origin: harbby/presto-connectors

public T index(boolean index) {
  if (index) {
    if (fieldType.indexOptions() == IndexOptions.NONE) {
      /*
       * the logic here is to reset to the default options only if we are not indexed ie. options are null
       * if the fieldType has a non-null option we are all good it might have been set through a different
       * call.
       */
      IndexOptions options = getDefaultIndexOption();
      if (options == IndexOptions.NONE) {
        // can happen when an existing type on the same index has disabled indexing
        // since we inherit the default field type from the first mapper that is
        // created on an index
        throw new IllegalArgumentException("mapper [" + name + "] has different [index] values from other types of the same index");
      }
      fieldType.setIndexOptions(options);
    }
  } else {
    fieldType.setIndexOptions(IndexOptions.NONE);
  }
  return builder;
}
origin: apache/servicemix-bundles

public T index(boolean index) {
  if (index) {
    if (fieldType.indexOptions() == IndexOptions.NONE) {
      /*
       * the logic here is to reset to the default options only if we are not indexed ie. options are null
       * if the fieldType has a non-null option we are all good it might have been set through a different
       * call.
       */
      IndexOptions options = getDefaultIndexOption();
      if (options == IndexOptions.NONE) {
        // can happen when an existing type on the same index has disabled indexing
        // since we inherit the default field type from the first mapper that is
        // created on an index
        throw new IllegalArgumentException("mapper [" + name + "] has different [index] values from other types of the same index");
      }
      fieldType.setIndexOptions(options);
    }
  } else {
    fieldType.setIndexOptions(IndexOptions.NONE);
  }
  return builder;
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

public T index(boolean index) {
  if (index) {
    if (fieldType.indexOptions() == IndexOptions.NONE) {
      /*
       * the logic here is to reset to the default options only if we are not indexed ie. options are null
       * if the fieldType has a non-null option we are all good it might have been set through a different
       * call.
       */
      IndexOptions options = getDefaultIndexOption();
      if (options == IndexOptions.NONE) {
        // can happen when an existing type on the same index has disabled indexing
        // since we inherit the default field type from the first mapper that is
        // created on an index
        throw new IllegalArgumentException("mapper [" + name + "] has different [index] values from other types of the same index");
      }
      fieldType.setIndexOptions(options);
    }
  } else {
    fieldType.setIndexOptions(IndexOptions.NONE);
  }
  return builder;
}
origin: com.strapdata.elasticsearch/elasticsearch

public T index(boolean index) {
  if (index) {
    if (fieldType.indexOptions() == IndexOptions.NONE) {
      /*
       * the logic here is to reset to the default options only if we are not indexed ie. options are null
       * if the fieldType has a non-null option we are all good it might have been set through a different
       * call.
       */
      IndexOptions options = getDefaultIndexOption();
      if (options == IndexOptions.NONE) {
        // can happen when an existing type on the same index has disabled indexing
        // since we inherit the default field type from the first mapper that is
        // created on an index
        throw new IllegalArgumentException("mapper [" + name + "] has different [index] values from other types of the same index");
      }
      fieldType.setIndexOptions(options);
    }
  } else {
    fieldType.setIndexOptions(IndexOptions.NONE);
  }
  return builder;
}
origin: apache/servicemix-bundles

  protected void setupFieldType(BuilderContext context) {
    fieldType.setName(buildFullName(context));
    if (context.indexCreatedVersion().before(Version.V_5_0_0_alpha1)) {
      fieldType.setOmitNorms(fieldType.omitNorms() && fieldType.boost() == 1.0f);
    }
    if (fieldType.indexAnalyzer() == null && fieldType.tokenized() == false && fieldType.indexOptions() != IndexOptions.NONE) {
      fieldType.setIndexAnalyzer(Lucene.KEYWORD_ANALYZER);
      fieldType.setSearchAnalyzer(Lucene.KEYWORD_ANALYZER);
    }
    boolean defaultDocValues = defaultDocValues(context.indexCreatedVersion());
    defaultFieldType.setHasDocValues(defaultDocValues);
    if (docValuesSet == false) {
      fieldType.setHasDocValues(defaultDocValues);
    }
  }
}
org.elasticsearch.index.mapperFieldMapper$Builder

Most used methods

  • fieldType
  • docValues
  • setupFieldType
  • addMultiField
  • boost
  • buildFullName
  • copyTo
  • getDefaultIndexOption
  • includeInAll
  • index
  • indexAnalyzer
  • indexOptions
  • indexAnalyzer,
  • indexOptions,
  • name,
  • omitNorms,
  • searchAnalyzer,
  • similarity,
  • store,
  • storeTermVectorOffsets,
  • storeTermVectorPayloads,
  • storeTermVectorPositions

Popular in Java

  • Reading from database using SQL prepared statement
  • getContentResolver (Context)
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Path (java.nio.file)
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Join (org.hibernate.mapping)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now