Created
December 29, 2010 00:42
-
-
Save iladriano/757969 to your computer and use it in GitHub Desktop.
test docvar_filters
This file contains 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
require 'rubygems' | |
require 'indextank' | |
api_client = IndexTank::Client.new 'api url' | |
index = api_client.indexes 'eurotrip' | |
index.document('post4').add({ :text => '4I need my Duke.4'}, :variables => { 0 => 1, 1 => 4 }) | |
index.document('post5').add({ :text => '5Duke Nukem is awesome.5'}, :variables => { 0 => 2, 1 => 5 }) | |
index.document('post6').add({ :text => '6People who love Duke Nukem6'}, :variables => { 0 => 3, 1 => 6 }) | |
index.search('Duke') | |
index.document('post4').add({ :text => '4I need my Duke. 4'}, :variables => { 0 => 1, 1 => 4 }) | |
index.search('Duke') | |
index.search('Duke', :docvar_filters => { 0 => [[0,10]] } ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment