[Xapian-discuss] Node.js binding
James Aylett
james-xapian at tartarus.org
Sun Oct 23 19:50:15 BST 2011
On 21 Oct 2011, at 15:59, Liam wrote:
> For Enquire::get_mset(callback), the callback will return an array of
> objects (which include a Document):
> { id: string,
> rank: number,
> weight: number,
> collapse_key: string,
> collapse_count: number,
> percent: number,
> description: string,
> document: object // Document
> }
>
> Sound reasonable?
You almost certainly don't need percent; most people never have a use for this. Also, if you're not giving parameters to `get_mset` then you want to return something lazy rather than an array, something more like a generator (I don't know what's available to you in V8 & Node). Xapian matches are explicitly paged (so you pull an MSet for a number of entries from a specific offset). Using a generator approach you can implement the paging below the level of the application (perhaps with initial hints), similar to how many ORMs work for LIMIT paging in SQL.
J
--
James Aylett
talktorex.co.uk - xapian.org - devfort.com - spacelog.org
More information about the Xapian-discuss
mailing list