Class: Ace::Search::Organisms::UnifiedSearcher

Inherits:
Object
  • Object
show all
Defined in:
lib/ace/search/organisms/unified_searcher.rb

Overview

Main search orchestration - coordinates search execution This is an organism - orchestrates atoms and molecules for search operations

Instance Method Summary collapse

Constructor Details

#initializeUnifiedSearcher

Returns a new instance of UnifiedSearcher.



11
12
13
14
15
16
# File 'lib/ace/search/organisms/unified_searcher.rb', line 11

def initialize
  @rg_executor = Atoms::RipgrepExecutor
  @fd_executor = Atoms::FdExecutor
  @result_parser = Atoms::ResultParser
  @dwim_analyzer = Molecules::DwimAnalyzer.new
end

Instance Method Details

#search(pattern, options = {}) ⇒ Hash

Execute search with given options

Parameters:

  • pattern (String)

    Search pattern

  • options (Hash) (defaults to: {})

    Search options

Returns:

  • (Hash)

    Search results



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/ace/search/organisms/unified_searcher.rb', line 22

def search(pattern, options = {})
  search_mode = determine_search_mode(pattern, options)

  case search_mode
  when :file
    search_files(pattern, options)
  when :content
    search_content(pattern, options)
  when :hybrid
    search_hybrid(pattern, options)
  else
    search_content(pattern, options)
  end
end