Class: Picky::Backends::File
- Defined in:
- lib/picky/backends/file.rb,
lib/picky/backends/file/json.rb,
lib/picky/backends/file/basic.rb
Overview
Naive implementation of a file-based index. In-Memory Hash with length, offset:
{ :bla => [20, 312] }
That map to positions the File, encoded in JSON:
...[1,2,3,21,7,4,13,15]...
Defined Under Namespace
Instance Method Summary collapse
- #create_similarity(bundle, _ = nil) ⇒ Object
- #create_weights(bundle, _ = nil) ⇒ Object
- #json(*args) ⇒ Object
Methods inherited from Backend
#create_configuration, #create_inverted, #create_realtime, #ids, #to_s
Instance Method Details
#create_similarity(bundle, _ = nil) ⇒ Object
17 18 19 |
# File 'lib/picky/backends/file.rb', line 17 def create_similarity bundle, _ = nil json bundle.index_path(:similarity) end |
#create_weights(bundle, _ = nil) ⇒ Object
13 14 15 |
# File 'lib/picky/backends/file.rb', line 13 def create_weights bundle, _ = nil Memory::JSON.new bundle.index_path(:weights) end |
#json(*args) ⇒ Object
7 8 9 |
# File 'lib/picky/backends/file/json.rb', line 7 def json *args JSON.new *args end |