Class MetaSchema

java.lang.Object
ch.rswk.meta.engine.MetaSchema

@Singleton public class MetaSchema extends Object
MetaSchema handles generating Lucene Document fields from JSON schemas. Defines built in meta schema types and the mechanism for using them in JSON schemas with JsonSchemaFactory. Provides map of PointsConfig in pointsConfig() for searching numeric Lucene fields.

Built in schema types available for MetaType and MetaAction schemas:

In addition to the built in types, generation of Lucene fields can be customized in a number of ways:

All custom generators instances must be injected.

See Also:
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
    • ANY_OF_VALUE

      private static final String ANY_OF_VALUE
    • ARRAY_TYPE

      private static final String ARRAY_TYPE
    • DEFAULT_ANALYZERS

      private static final Map<String,org.apache.lucene.analysis.Analyzer> DEFAULT_ANALYZERS
    • DEFAULT_POINT_CONFIGS

      private static final Map<String,org.apache.lucene.queryparser.flexible.standard.config.PointsConfig> DEFAULT_POINT_CONFIGS
    • DEFINITIONS_REF_PREFIX

      private static final String DEFINITIONS_REF_PREFIX
    • ILLEGAL_FIELD_GENERATOR

      private static final MetaSchema.FieldGenerator ILLEGAL_FIELD_GENERATOR
    • ILLEGAL_FIELD_NAMES

      private static final Set<String> ILLEGAL_FIELD_NAMES
    • ITEMS_VALUE

      private static final String ITEMS_VALUE
    • JSON_DRAFT_SCHEMA_URI

      private static final String JSON_DRAFT_SCHEMA_URI
    • META_URI_SCHEME

      private static final String META_URI_SCHEME
      See Also:
    • OBJECT_TYPE

      private static final String OBJECT_TYPE
    • ONE_OF_VALUE

      private static final String ONE_OF_VALUE
    • PROPERTIES_VALUE

      private static final String PROPERTIES_VALUE
    • REF_VALUE

      private static final String REF_VALUE
    • SCHEMA_GENERATORS

      private static final Set<MetaSchema.AbstractSchemaFieldGenerator> SCHEMA_GENERATORS
    • SCHEMA_ID_FORMAT

      private static final String SCHEMA_ID_FORMAT
      See Also:
    • SIMPLE_SCHEMA_FORMAT

      private static final String SIMPLE_SCHEMA_FORMAT
      See Also:
    • TYPE_VALUE

      private static final String TYPE_VALUE
    • analyzers

      private final Map<String,org.apache.lucene.analysis.Analyzer> analyzers
    • draftSchema

      private final com.networknt.schema.JsonSchema draftSchema
    • generatorsByFieldName

      private final Map<String,MetaSchema.FieldGenerator> generatorsByFieldName
    • generatorsByMetaTypeId

      private final Map<String,MetaSchema.AbstractMetaTypeFieldGenerator> generatorsByMetaTypeId
    • generatorsByTypeRef

      private final Map<String,MetaSchema.AbstractSchemaFieldGenerator> generatorsByTypeRef
    • pointConfigs

      private final Map<String,org.apache.lucene.queryparser.flexible.standard.config.PointsConfig> pointConfigs
    • schemaFactory

      private final com.networknt.schema.JsonSchemaFactory schemaFactory
  • Constructor Details

  • Method Details

    • registerGenerators

      private void registerGenerators(Set<MetaSchema.FieldGenerator> generators)
    • buildJsonSchemaFactory

      private com.networknt.schema.JsonSchemaFactory buildJsonSchemaFactory()
    • indexMetaType

      public void indexMetaType(MetaType type)
    • indexSchema

      private void indexSchema(com.fasterxml.jackson.databind.JsonNode schema)
    • indexFieldsRecursive

      private static void indexFieldsRecursive(Consumer<MetaSchema.IndexableField> consumer, com.fasterxml.jackson.databind.JsonNode node, @Nullable Consumer<MetaSchema.IndexableField> rootConsumer)
    • getFieldTypeRecursive

      private static Optional<String> getFieldTypeRecursive(com.fasterxml.jackson.databind.JsonNode field)
    • appendLogDataFields

      public void appendLogDataFields(org.apache.lucene.document.Document document, MetaLog meta)
    • appendObjectValueFields

      public void appendObjectValueFields(org.apache.lucene.document.Document document, MetaObject meta, Set<String> sortableFields)
    • appendFieldsRecursive

      private void appendFieldsRecursive(org.apache.lucene.document.Document document, String metaId, @Nullable String name, com.fasterxml.jackson.databind.JsonNode node, Set<String> sortableFields)
    • pointsConfig

      public Map<String,org.apache.lucene.queryparser.flexible.standard.config.PointsConfig> pointsConfig()
    • analyzers

      public Map<String,org.apache.lucene.analysis.Analyzer> analyzers()
    • newSchema

      public static String newSchema(@Nullable String id, String schema)
    • getSchema

      public com.networknt.schema.JsonSchema getSchema(URI uri)
    • getSchema

      public com.networknt.schema.JsonSchema getSchema(com.fasterxml.jackson.databind.JsonNode schema)
    • draftSchema

      public com.networknt.schema.JsonSchema draftSchema()