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
// mkdir indextank | |
// wget https://github.com/SPORE/api-description/blob/master/services/indextank.json | |
// install node and npm | |
// npm install spore underscore futures | |
// edit baseUrl, password and index var | |
// node indextank.js | |
var baseUrl = 'http://xxx.api.indextank.com'; | |
var password = 'xxx'; | |
var index = 'test_spore'; |
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') |