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

java.lang.Object
  extended by org.compass.core.mapping.json.builder.JsonMappingBuilder
All Implemented Interfaces:
ResourceMappingProvider

public class JsonMappingBuilder
extends Object
implements ResourceMappingProvider

A builder allowing to constrcut json mapping definition.

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

Constructor Summary
JsonMappingBuilder(String alias)
          Constructs a new (root) JSON Mapping based on the specified alias.
 
Method Summary
 JsonMappingBuilder add(JsonAnalyzerMappingBuilder builder)
          Adds a json analyzer property mapping definition.
 JsonMappingBuilder add(JsonArrayMappingBuilder builder)
          Adds a json array mapping definition.
 JsonMappingBuilder add(JsonBoostMappingBuilder builder)
          Adds a json boost property mapping definition.
 JsonMappingBuilder add(JsonContentMappingBuilder builder)
          Adds a json content mapping definition.
 JsonMappingBuilder add(JsonIdMappingBuilder builder)
          Adds a json id mapping definition.
 JsonMappingBuilder add(JsonObjectMappingBuilder builder)
          Adds a json object mapping definition.
 JsonMappingBuilder add(JsonPropertyMappingBuilder builder)
          Adds a json property mapping definition.
 JsonMappingBuilder all(JsonAllMappingBuilder allMappingBuilder)
          Sets the "all" level mapping definition.
 JsonMappingBuilder analyzer(String analyzer)
          The name of the analyzer that will be used to analyze ANALYZED properties.
 JsonMappingBuilder boost(float boost)
          Sets the boost value for the json.
 JsonMappingBuilder dynamic(boolean dynamic)
          Should unmapped json elements be added to the search engine automatically (and recursively).
 JsonMappingBuilder dynamicNaming(Naming dynamicNaming)
          Sets how dynamic objects, arrays and properties added through this object will have their respective property names named.
 JsonMappingBuilder extendsAliases(String... extendedAliases)
          Sets the list of other json mappings that this mapping will extend and inherit internal mappings from.
 ResourceMapping getMapping()
          Returns the mapping constructed.
 JsonMappingBuilder spellCheck(SpellCheck spellCheck)
          Sets the spell check mode that will be used for this json mapping (and for all the internal mappings that do not explicitly set their own spell check mode).
 JsonMappingBuilder subIndex(String subIndex)
          Sets a sub index that will be used for this resource.
 JsonMappingBuilder subIndex(SubIndexHash subIndexHash)
          Sets a custom sub index hashing strategy for the resource mapping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonMappingBuilder

public JsonMappingBuilder(String alias)
Constructs a new (root) JSON Mapping based on the specified alias.

Method Detail

getMapping

public ResourceMapping getMapping()
Returns the mapping constructed. Used in CompassConfiguration.addMapping(org.compass.core.mapping.ResourceMappingProvider).

Specified by:
getMapping in interface ResourceMappingProvider

subIndex

public JsonMappingBuilder subIndex(String subIndex)
Sets a sub index that will be used for this resource. Basically uses ConstantSubIndexHash.


subIndex

public JsonMappingBuilder subIndex(SubIndexHash subIndexHash)
Sets a custom sub index hashing strategy for the resource mapping.


extendsAliases

public JsonMappingBuilder extendsAliases(String... extendedAliases)
Sets the list of other json mappings that this mapping will extend and inherit internal mappings from.


spellCheck

public JsonMappingBuilder spellCheck(SpellCheck spellCheck)
Sets the spell check mode that will be used for this json mapping (and for all the internal mappings that do not explicitly set their own spell check mode). If not set will use the global spell check setting.


analyzer

public JsonMappingBuilder analyzer(String analyzer)
The name of the analyzer that will be used to analyze ANALYZED properties. Defaults to the default analyzer which is one of the internal analyzers that comes with Compass. If not set, will use the default analyzer.

Note, that when using the json-analyzer mapping (a child mapping of json mapping) (for a json property value that controls the analyzer), the analyzer attribute will have no effects.


boost

public JsonMappingBuilder boost(float boost)
Sets the boost value for the json.


dynamic

public JsonMappingBuilder dynamic(boolean dynamic)
Should unmapped json elements be added to the search engine automatically (and recursively). Defaults to false.


dynamicNaming

public JsonMappingBuilder dynamicNaming(Naming dynamicNaming)
Sets how dynamic objects, arrays and properties added through this object will have their respective property names named.


all

public JsonMappingBuilder all(JsonAllMappingBuilder allMappingBuilder)
Sets the "all" level mapping definition.


add

public JsonMappingBuilder add(JsonIdMappingBuilder builder)
Adds a json id mapping definition.


add

public JsonMappingBuilder add(JsonPropertyMappingBuilder builder)
Adds a json property mapping definition.


add

public JsonMappingBuilder add(JsonAnalyzerMappingBuilder builder)
Adds a json analyzer property mapping definition.


add

public JsonMappingBuilder add(JsonBoostMappingBuilder builder)
Adds a json boost property mapping definition.


add

public JsonMappingBuilder add(JsonContentMappingBuilder builder)
Adds a json content mapping definition.


add

public JsonMappingBuilder add(JsonObjectMappingBuilder builder)
Adds a json object mapping definition.


add

public JsonMappingBuilder add(JsonArrayMappingBuilder builder)
Adds a json array mapping definition.



Copyright (c) 2004-2009 The Compass Project.