[sword-devel] Re: [bt-devel] fast search

David Burry sword-devel@crosswire.org
Thu, 08 Feb 2001 11:26:19 -0800


At 08:05 AM 2/8/2001 -0600, kbrannen@gte.net wrote:
>Trevor Jenkins wrote:
>> 
>> On Wed, 7 Feb 2001, kbrannen@gte.net <kbrannen@gte.net> wrote:
>> 
>> > Trevor Jenkins wrote:
>> 
>> > > > Yes, but the size of one given book or commentary would never change
>> > > > once the book is finished.
>> > >
>> > > You're forgetting personal notes. These are expected to grow. After years
>> > > of use I'd expect to be able to search my notes with the same speed I
>> > > search the Bible text or someone else's notes ... uh book.
>> >
>> > I know that QuickVerse (and probably others) get around this by making the
>> > "notes" a separate file; hence, the book really doesn't change sizes.
>> 
>> Sorry I meant to say that my notes will eventually be a "book". Because
>> I'm working on them at all the time the size of the book increases. But I
>> expect the same search facility to be availabe for the Bible modules,
>> extant books and for my constantly growing personal book(s).
>
>OK, that's reasonable. :-)


It's not unreasonable to have two different indexing algorithms both in use, one more optimized faster one for static books that never change, one more flexible slower one for dynamic books.  Better than having a slow algorithm for everything.

The trick is to make them both invisibly work the same in the API without the user (and possibly not even the interface programmer) having to know which book is using which.  This can be difficult if your inverted list indexes all the words ignoring punctuation, but your slower brute force search includes the punctuation, for instance.

Dave