Class: Lutaml::UmlRepository::StaticSite::SearchIndexBuilder

Inherits:
Object
  • Object
show all
Includes:
Lutaml::Uml::ModelHelpers
Defined in:
lib/lutaml/uml_repository/static_site/search_index_builder.rb

Constant Summary collapse

STOP_WORDS =
%w[
  the a an and or but in on at to for of with from by
  is are was were be been being have has had
  this that these those it its
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Lutaml::Uml::ModelHelpers

#class_type_for, #extract_package_path, #format_cardinality, #format_definition, #normalize_stereotypes, #package_path_for, #parse_cardinality, #qualified_name_for

Constructor Details

#initialize(repository, options = {}) ⇒ SearchIndexBuilder

Returns a new instance of SearchIndexBuilder.



17
18
19
20
21
# File 'lib/lutaml/uml_repository/static_site/search_index_builder.rb', line 17

def initialize(repository, options = {})
  @repository = repository
  @options = default_options.merge(options)
  @id_generator = IdGenerator.new
end

Instance Attribute Details

#id_generatorObject (readonly)

Returns the value of attribute id_generator.



15
16
17
# File 'lib/lutaml/uml_repository/static_site/search_index_builder.rb', line 15

def id_generator
  @id_generator
end

#optionsObject (readonly)

Returns the value of attribute options.



15
16
17
# File 'lib/lutaml/uml_repository/static_site/search_index_builder.rb', line 15

def options
  @options
end

#repositoryObject (readonly)

Returns the value of attribute repository.



15
16
17
# File 'lib/lutaml/uml_repository/static_site/search_index_builder.rb', line 15

def repository
  @repository
end

Instance Method Details

#buildObject



23
24
25
26
27
28
# File 'lib/lutaml/uml_repository/static_site/search_index_builder.rb', line 23

def build
  Models::SpaSearchIndex.new(
    fields: field_definitions,
    document_store: build_document_store,
  )
end