some refactor in the index searcher
This commit is contained in:
parent
90a13feab4
commit
6c685b4840
|
@ -16,10 +16,11 @@ class Polecat
|
|||
# IndexSearcher.new 'index_dir'
|
||||
# IndexSearcher.new(IndexReader.new 'index_dir')
|
||||
def initialize *args
|
||||
if args[0].class == Polecat::IndexReader
|
||||
@reader = args[0]
|
||||
elsif args[0].class == String
|
||||
@reader = Polecat::IndexReader.new args[0]
|
||||
first = args[0]
|
||||
if first.class == Polecat::IndexReader
|
||||
@reader = first
|
||||
elsif first.class == String
|
||||
@reader = Polecat::IndexReader.new first
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue