Module: Glancer::Indexer
- Defined in:
- lib/glancer/indexer.rb,
lib/glancer/indexer/model_indexer.rb,
lib/glancer/indexer/schema_indexer.rb,
lib/glancer/indexer/context_indexer.rb
Defined Under Namespace
Modules: ContextIndexer, ModelIndexer, SchemaIndexer
Class Method Summary collapse
Class Method Details
.rebuild_all! ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/glancer/indexer.rb', line 11 def rebuild_all! Glancer::Utils::Logger.info("Indexer", "Starting full index rebuild...") chunks = [] if Glancer.configuration. Glancer::Utils::Logger.info("Indexer", "Indexing schema (enabled by configuration)...") chunks += SchemaIndexer.index! else Glancer::Utils::Logger.debug("Indexer", "Schema indexing is disabled in configuration.") end if Glancer.configuration. Glancer::Utils::Logger.info("Indexer", "Indexing models (enabled by configuration)...") chunks += ModelIndexer.index! else Glancer::Utils::Logger.debug("Indexer", "Model indexing is disabled in configuration.") end if Glancer.configuration.context_file_path Glancer::Utils::Logger.info("Indexer", "Indexing context file (path configured)...") chunks += ContextIndexer.index! else Glancer::Utils::Logger.debug("Indexer", "No context file path configured. Skipping context indexing.") end Glancer::Utils::Logger.info("Indexer", "Indexing completed. Total chunks: #{chunks.size}") Glancer::Utils::Logger.debug("Indexer", "Storing documents into retriever...") Retriever.store_documents(chunks) Glancer::Utils::Logger.info("Indexer", "Documents stored successfully.") chunks rescue StandardError => e Glancer::Utils::Logger.error("Indexer", "Index rebuilding failed: #{e.class} - #{e.}") Glancer::Utils::Logger.debug("Indexer", "Backtrace:\n#{e.backtrace.join("\n")}") raise Glancer::Error, "Index rebuilding failed: #{e.}" end |