[Xapian-discuss] Node.js binding

Liam xapian at networkimprov.net
Thu Nov 3 02:40:12 GMT 2011


On Wed, Nov 2, 2011 at 6:36 PM, Olly Betts <olly at survex.com> wrote:

> It feel that bindings for node.js are really more akin to a plugin for a
> framework.  While the "js" part is certainly a language, the "node."
> part brings in a whole set of ways of thinking about things which makes
> it much more like a framework.
>

The Node guys would disagree; Node isn't trying to be a framework. But yes,
you do have to rethink APIs given both the cost of crossing the JS-C++
boundary, and the need to hand blocking ops off to the thread pool.

So rather than trying to directly map the Xapian API into node.js, I
> would suggest you instead think about the sort of API which you would
> ideally want to use for text indexing and search in node.js, and then
> implement *that* API using Xapian.
>

I prefer to map as closely to the underlying API as is reasonable, so the
user can rely on the underlying documentation. Also I assume the native API
is proven in the real world.

I did diverge from the native API in my add_document implementation (will
rename to index_document) but expect to adjust that to be closer to native.


More information about the Xapian-discuss mailing list