Mailing List Archive

Doc nums now start at 1 rather than 0.
Greets,

Nathan suggested a while back that document numbers should start at 1
rather than 0. Starting at 1 has many advantages, because it allows
document numbers to be treated as boolean values. For example:
Scorer_Next, Scorer_Skip_To, PList_Next, and PList_Skip_To can all
return a document number instead of a boolean, potentially
eliminating certain additional method calls to retrieve a doc num and
thus allowing some loops to be tightened.

At the time, I wasn't sure it was going to be feasible to make
Nathan's suggestion work, as the assumption that doc numbers start at
0 was fairly deeply embedded. However, I gave it a go, and it wasn't
as hard as I anticipated -- so the change has been committed as of
r2603. The commit is fairly long, but most of it is superficial -- a
lot of document numbers in the test suite simply needed to be
incremented, and the meat of the commit comprises less than half of
the changed lines.

Please be aware that this is a backwards-incompatible change. It is
probably possible to make things work with existing indexes, but it
would involve adding some rather complicated tests and some mods to
the library to generate old indexes on command, which I'm disinclined
to take on.

Just to be clear, this change was made *after* the release of 0.20_05.

Marvin Humphrey
Rectangular Research
http://www.rectangular.com/



_______________________________________________
KinoSearch mailing list
KinoSearch@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch
Re: Doc nums now start at 1 rather than 0. [ In reply to ]
> However, I gave it a go, and it wasn't
> as hard as I anticipated -- so the change has been committed as of
> r2603.

Wow! Yay! Congratulations on the quick work. I think this is a very
useful change that is going to make a lot of things easier in the
future.

--nate

_______________________________________________
KinoSearch mailing list
KinoSearch@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch