[sword-devel] Fast search -- some ideas

Brandon Staggs sword-devel@crosswire.org
Thu, 31 Aug 2000 11:15:47 -1000


> >> Proximity: ...
> > As might be guessed from my earlier comments this is an
> > area that I have given a lot of thought to what is involved. :-)
>
> I would gladly learn some more about this. This where I believe
> the real value of powerful searching can come in.

For what it's worth, proximity searching where the users says "these words
within X verses of each other" should be fairly trivial to implement, once
you have your bitmaps set. All you have to do is instead of ANDing the two
bitmaps (if they are searching for two words) is iterate through each
position, then look for a corresponding position in the other maps within X
positions. Then set up a new bitmap and flip all the bits in that range True
where necessary.

If you want to offer "within X words" or "within X sentences" or "within X
paragraphs" or whathaveyou then you need to get more complex and pick up
that _Managing Gigabytes_ book.

But the reality is that most people are fine doing a simple AND search
within verses, and this is by far the greatest use of the searching funtion
in Bible software.

-Brandon