IndexTank interface for Node.js

45 views
Skip to first unread message

Simon Weare

unread,
Jun 25, 2011, 6:42:23 AM6/25/11
to inde...@googlegroups.com
I have just published a basic API wrapper for using IndexTank in Node.js applications. It's written in CoffeeSctipt and is currently experimental, but functional. The source is on github at http://bit.ly/lLT5MB, and can be installed via npm. Please report issues here: http://bit.ly/iQCsrz.

Simon

dbasch

unread,
Jun 26, 2011, 12:13:04 PM6/26/11
to indextank
Thanks! I added it to this post:

http://blog.indextank.com/737/the-state-of-the-indextank-ecosystem/

On Jun 25, 3:42 am, Simon Weare <kai...@gmail.com> wrote:
> I have just published a basic API wrapper for using IndexTank in Node.js
> applications. It's written in CoffeeSctipt and is currently experimental,
> but functional. The source is on github athttp://bit.ly/lLT5MB, and can be

Simon Weare

unread,
Jun 28, 2011, 5:58:47 PM6/28/11
to inde...@googlegroups.com
Updated version available (v0.0.1-1).

Finished implementing all published v1 methods (except batch add/delete methods).
Significantly refactored (without breaking v0.0.1 api).
Source code on github at http://bit.ly/lLT5MB.
See the README for the details.
Report issues here http://bit.ly/iQCsrz

Install (or update) with npm - 

npm install node-indextank

or 

npm -g install node-indextank


Simon Weare

unread,
Jun 28, 2011, 6:01:53 PM6/28/11
to inde...@googlegroups.com
Cheers!

Updated version released completing the basic implementation.

You wouldn't happen to have some examples of setting scoring variables and query promotion would you????

Implemented them to the spec, but not entirely sure how to use them!

Simon

Mono Buthay

unread,
Jun 28, 2011, 8:44:19 PM6/28/11
to inde...@googlegroups.com
Hi Simon,

We have a bunch of examples for variable setting.

You can check out Tanker  https://github.com/kidpollo/tanker, which gives indextank powers to any ruby ORM.

You can also take a look at the feeding code for loqix.com/cb/ .. http://pastebin.com/s5dATMC3
Line 35 handles the variable setting.

Note that you can send variables when adding a document, or you can just update variables for a given document. The JSON dict you need to send is the same for both cases.

The only public example of query promote I can think of is on our wordpress plugin.

Just let me know if you need more examples.

Best,
--
Mono Buthay
follow us @indextank

Simon Weare

unread,
Jun 29, 2011, 6:00:56 AM6/29/11
to inde...@googlegroups.com
Cheers for those,

The examples of scoring variables have helped me grok what they're
used for (i think ;-)). I wasn't too clear before. I hope I'm right in
saying that you calculate the values for them from some (numeric)
attribute of what your indexing. (In one of the examples you link to,
they look to be calculated from the length of various fields). You
then use the scoring variable fields (by index) in a scoring function
and ordering is automatic?

With promotion, I could really do with a quick clarification of what
you need to put in the query field - is it simply a complete query
string as you would provide to the search method i.e "body:test OR
additional:test" ?

Thanks in advance
Simon

Mono Buthay

unread,
Jun 29, 2011, 12:43:23 PM6/29/11
to inde...@googlegroups.com
Hi,

Yeap, the variables are numerical values. You can use them to score your documents, and also to filter documents, ie. search for "title:test" and only return those documents whose variable 1 is between 3 and 4, or higher that 7.

For promotion, the idea is that for a given query (whatever the query is, can have field names, boolean operators, you name it) you can pick a document to appear as first result. No matter what relevance says, no matter what scoring variables are.

Simon

unread,
Jun 29, 2011, 2:52:38 PM6/29/11
to inde...@googlegroups.com
Righto,

Think I'll sit on promotion for a bit - don't have much need for it at moment.

Thanks for the scoring variables info. Think I've wrapped my brain around it now. Need to throw in some documents and have a proper play around with them.

Thanks again, I've had nothing but top notch support so far - feel guilty that I'm only using the free plan!

Simon
Reply all
Reply to author
Forward
0 new messages