class SearchIngest::Schemas
- SearchIngest::Schemas
- Reference
- Object
Defined in:
search-ingest/schemas.crConstant Summary
-
MODEL_METADATA =
{} of Nil => Nil
-
Extracted metadata from ORM classes
-
MODELS =
{} of Nil => Nil
-
All PgORM models with abstract and empty classes removed :nodoc:
-
TYPE_FIELD =
Field.new("_document_type", "keyword")
-
Allows several document types beneath a single index
Constructors
Class Method Summary
-
.document_name(model : Class | String)
Strips the namespace from the model
-
.equivalent_schema?(existing_schema : String | Nil, proposed_schema : String | Nil) : Bool
Traverse schemas and test equality
Instance Method Summary
-
#children(model : Class | String)
Get names of all children associated with model
-
#collect_index_properties(model : String | Class, children : Array(String) | Nil = nil) : Array(Field)
Collects all properties relevant to an index and collapse them into a schema
-
#construct_document_schema(model) : String
Generate the index type mapping structure
-
#generate_index_properties(model, child = false) : Array(Field)
Now that we are generating joins on the parent_id, we need to specify if we are generating a child or a single document Maps from crystal types to Elasticsearch field datatypes
-
#generate_properties(models)
Construct properties for given models
-
#generate_schemas(models)
Generate a map of models to schemas
-
#index_name(model) : String
Look up index name by class
-
#index_schema(model : Class | String) : String
Look up model schema by class
- #index_schemas(klass : Class | String)
-
#index_schemas : Hash(String, String)
Map from class name to schema
-
#join_field(model, children)
Generate join fields for parent relations
-
#models : Array(String)
Class names of managed tables
-
#parents(model : Class | String) : Array(Parent)
Find name and ES routing of document's parents
- #properties(klass : Class | String)
-
#properties : Hash(String, Array(Field))
Map class name to model properties
- #validate_tag(tag)
Macro Summary
Constructor Detail
Class Method Detail
Traverse schemas and test equality
ameba:disable Metrics/CyclomaticComplexity
Instance Method Detail
Collects all properties relevant to an index and collapse them into a schema
Now that we are generating joins on the parent_id, we need to specify if we are generating a child or a single document Maps from crystal types to Elasticsearch field datatypes
Find name and ES routing of document's parents