Skip to content

Instantly share code, notes, and snippets.

@floere
Created October 30, 2011 04:38
Show Gist options
  • Select an option

  • Save floere/1325496 to your computer and use it in GitHub Desktop.

Select an option

Save floere/1325496 to your computer and use it in GitHub Desktop.
How to dump the indexes after e.g. realtime indexing.
# Available from Picky 3.2.1.
#
require 'picky'
index = Picky::Index.new :dump_test do
category :name
end
Thing = Struct.new :id, :name
index.replace Thing.new(1, 'Picky')
index.replace Thing.new(2, 'Parslet')
index.dump
puts `ls -al #{Dir.pwd}/index/development/dump_test`
puts `cat #{Dir.pwd}/index/development/dump_test/name_exact_inverted.memory.json`
puts `cat #{Dir.pwd}/index/development/dump_test/name_partial_weights.memory.json`
things = Picky::Search.new index
p things.search("Picky").ids
@floere

floere commented Oct 30, 2011

Copy link
Copy Markdown
Author

You could use this e.g. to debug (if you are adverse to testing ;) ) your realtime indexes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment