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

Inherits:
Object
  • Object
show all
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

Constructor Details

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

Returns a new instance of SearchIndexBuilder.



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

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.



10
11
12
# File 'lib/lutaml/uml_repository/static_site/search_index_builder.rb', line 10

def id_generator
  @id_generator
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/lutaml/uml_repository/static_site/search_index_builder.rb', line 10

def options
  @options
end

#repositoryObject (readonly)

Returns the value of attribute repository.



10
11
12
# File 'lib/lutaml/uml_repository/static_site/search_index_builder.rb', line 10

def repository
  @repository
end

Instance Method Details

#buildObject



24
25
26
27
28
29
30
31
32
# File 'lib/lutaml/uml_repository/static_site/search_index_builder.rb', line 24

def build
  {
    version: "1.0.0",
    fields: field_definitions,
    ref: "id",
    documentStore: build_document_store,
    pipeline: ["stemmer", "stopWordFilter"],
  }
end