Created
October 30, 2011 04:38
-
-
Save floere/1325496 to your computer and use it in GitHub Desktop.
How to dump the indexes after e.g. realtime indexing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could use this e.g. to debug (if you are adverse to testing ;) ) your realtime indexes.