org.compass.core.mapping.json.builder
Class JsonPropertyMappingBuilder

java.lang.Object
  extended by org.compass.core.mapping.json.builder.JsonPropertyMappingBuilder

public class JsonPropertyMappingBuilder
extends Object

A builder allowing to constrcut json property mapping definition.

Author:
kimchy
See Also:
JSEM.property(String)

Field Summary
(package private)  JsonPropertyMapping mapping
           
 
Constructor Summary
JsonPropertyMappingBuilder(String name)
          Constructs a new JSON property mapping with the given name.
 
Method Summary
 JsonPropertyMappingBuilder analyzer(String analyzer)
          Sets the analyzer logical name that will be used to analyzer the property value.
 JsonPropertyMappingBuilder boost(float boost)
          Sets the boost value for the property mapping.
 JsonPropertyMappingBuilder excludeFromAll(ExcludeFromAll excludeFromAll)
          Controls if the property will be excluded from all or not.
 JsonPropertyMappingBuilder format(String format)
          Sets the format that will be used for formattable capable converters (such as numbers and dates).
 JsonPropertyMappingBuilder index(Property.Index index)
          Specifies whether and how a property should be indexed.
 JsonPropertyMappingBuilder indexName(String indexName)
          The name of the resource property that will be stored in the index.
 JsonPropertyMappingBuilder mappingConverter(Converter converter)
          Sets the actual converter that will be used to convert the JSON property.
 JsonPropertyMappingBuilder mappingConverter(String converterName)
          Sets the lookup converter name (registered with Compass) that will be used to convert the JSON property.
 JsonPropertyMappingBuilder namingType(Naming namingType)
          Controls the resource property name that will be used.
 JsonPropertyMappingBuilder nullValue(String nullValue)
          Sets the null value of the property.
 JsonPropertyMappingBuilder omitNorms(boolean omitNorms)
          If set, omit normalization factors associated with this indexed field.
 JsonPropertyMappingBuilder omitTf(boolean omitTf)
          If set, omit tf from postings of this indexed property.
 JsonPropertyMappingBuilder spellCheck(SpellCheck spellCheck)
          Sets the spell check specific setting for the mapping.
 JsonPropertyMappingBuilder store(Property.Store store)
          Specifies whether and how a property will be stored.
 JsonPropertyMappingBuilder termVector(Property.TermVector termVector)
          Specifies whether and how a property should have term vectors.
 JsonPropertyMappingBuilder valueConverter(Converter converter)
          Sets the actual converter that will be used to convert the actual value of the json property.
 JsonPropertyMappingBuilder valueConverter(ResourcePropertyConverter converter)
          Sets the actual converter that will be used to convert the actual value of the json property.
 JsonPropertyMappingBuilder valueConverter(String converterName)
          Sets the lookup converter name (registered with Compass) that will be used to convert the actual value of the json property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapping

final JsonPropertyMapping mapping
Constructor Detail

JsonPropertyMappingBuilder

public JsonPropertyMappingBuilder(String name)
Constructs a new JSON property mapping with the given name. The name can be null when used with array mapping.

Method Detail

indexName

public JsonPropertyMappingBuilder indexName(String indexName)
The name of the resource property that will be stored in the index. Defaults to the element name.


namingType

public JsonPropertyMappingBuilder namingType(Naming namingType)
Controls the resource property name that will be used. Default to Naming.PLAIN which means that only the element name / index name will be stored. If Naming.FULL is set, will use the full path (element1.element2.) to be stored in as the property name.


store

public JsonPropertyMappingBuilder store(Property.Store store)
Specifies whether and how a property will be stored. Deftauls to Property.Store.YES.


index

public JsonPropertyMappingBuilder index(Property.Index index)
Specifies whether and how a property should be indexed. Defaults to Property.Index.ANALYZED.


termVector

public JsonPropertyMappingBuilder termVector(Property.TermVector termVector)
Specifies whether and how a property should have term vectors. Defaults to Property.TermVector.NO.


omitNorms

public JsonPropertyMappingBuilder omitNorms(boolean omitNorms)
If set, omit normalization factors associated with this indexed field. This effectively disables indexing boosts and length normalization for this field. Defaults to false.


omitTf

public JsonPropertyMappingBuilder omitTf(boolean omitTf)
If set, omit tf from postings of this indexed property. Defaults to false.


boost

public JsonPropertyMappingBuilder boost(float boost)
Sets the boost value for the property mapping. Defaults to 1.0f.


format

public JsonPropertyMappingBuilder format(String format)
Sets the format that will be used for formattable capable converters (such as numbers and dates).


mappingConverter

public JsonPropertyMappingBuilder mappingConverter(String converterName)
Sets the lookup converter name (registered with Compass) that will be used to convert the JSON property. Defaults to JsonPropertyMappingConverter.


mappingConverter

public JsonPropertyMappingBuilder mappingConverter(Converter converter)
Sets the actual converter that will be used to convert the JSON property. Defaults to JsonPropertyMappingConverter.


valueConverter

public JsonPropertyMappingBuilder valueConverter(String converterName)
Sets the lookup converter name (registered with Compass) that will be used to convert the actual value of the json property. Detaults to SimpleJsonValueConverter.


valueConverter

public JsonPropertyMappingBuilder valueConverter(Converter converter)
Sets the actual converter that will be used to convert the actual value of the json property. Detaults to SimpleJsonValueConverter.


valueConverter

public JsonPropertyMappingBuilder valueConverter(ResourcePropertyConverter converter)
Sets the actual converter that will be used to convert the actual value of the json property. Detaults to SimpleJsonValueConverter.


analyzer

public JsonPropertyMappingBuilder analyzer(String analyzer)
Sets the analyzer logical name that will be used to analyzer the property value. The name is a lookup name for an Analyzer that is registered with Compass.


excludeFromAll

public JsonPropertyMappingBuilder excludeFromAll(ExcludeFromAll excludeFromAll)
Controls if the property will be excluded from all or not.


nullValue

public JsonPropertyMappingBuilder nullValue(String nullValue)
Sets the null value of the property. If the property value is null, will store in the index the provided value.


spellCheck

public JsonPropertyMappingBuilder spellCheck(SpellCheck spellCheck)
Sets the spell check specific setting for the mapping.



Copyright (c) 2004-2009 The Compass Project.