[Xapian-discuss] Node.js binding

Liam xapian at networkimprov.net
Fri Oct 21 09:51:38 BST 2011


On Thu, Oct 20, 2011 at 12:06 PM, Richard Boulton <richard at tartarus.org>wrote:

> On 20 October 2011 18:11, Liam <xapian at networkimprov.net> wrote:
> >> >  MSetIterator:: operator *(), get_percent(), get_document()
> >> get_document() is not safe here - the documents can be lazily loaded
> >> into the MSet object, so this can hit disk or network.
> >
> > Document::get_data() does I/O, so what does MSetIterator::get_document()
> do?
>
> Depends (on the backend, and possibly on other things); there's lazy
> loading going on here.
>

For Enquire::get_mset(), I plan to return an array of objects:
  { id: string,
    rank: number,
    weight: number,
    collapse_key: string,
    collapse_count: number,
    percent: number,
    description: string
  }

In lieu of MSetIterator::get_document(), I'd make a JS Document with:
  new xapian.Document(someMset[i].id)

Sound reasonable? (I'm sorta wondering why the native Document constructor
doesn't work this way.)


More information about the Xapian-discuss mailing list