On 6/17/06, Erik Hatcher <[EMAIL PROTECTED]> wrote:
> On Jun 16, 2006, at 3:08 PM, Sergei Serdyuk wrote:
> > Thank you Erik. It is not clear to me what it would look like in
> > Ferret,
> > but it sounds like a good direction to dig in.
>
> In Java, building up such filters is done with code like this:
>
>        TermEnum termEnum = reader.terms(new Term(field, ""));
>        while (true) {
>          Term term = termEnum.term();
>          if (term == null || !term.field().equals(field)) break;
>
>          termDocs.seek(term);
>          OpenBitSet bitSet = new OpenBitSet(reader.numDocs());
>          while (termDocs.next()) {
>            bitSet.set(termDocs.doc());
>          }
>
>          // ... cache bitSet for future use ...
>
>          if (! termEnum.next()) break;
>        }
>
> Ferret has a comparable API underneath that should make this sort of
> thing feasible in pure Ruby somehow.

It is similar in Ferret. Have a look here to see the solution to a
similar problem;

    http://www.ruby-forum.com/topic/56232#40931

Hope that helps.

Cheers,
Dave
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to