[sword-devel] Notes on the search progress bug

Troy A. Griffitts sword-devel@crosswire.org
Sat, 28 Oct 2000 19:28:45 -0700


I'm trying to figure out how:

key = BOTTOM
long highIndex = key.NewIndex()

can produce 8245

This is the high NT index, NOT the high ENTIRE BIBLE index.
NewIndex should always compute based on the entire bible, not just the
testament.

Hopefully, we'll figure it out soon.  Still looking....

In the mean time.  Here is some code I found that doesn't look quite
right:

cswordmoduleinfo.cpp (line 225...):

     if (searchOptions & CSwordModuleSearch::useLastResult)
          scope = &m_searchResult;
     else if (searchOptions & CSwordModuleSearch::useScope) {
          scope = new VerseKey(lowerBound, upperBound);
     }
...
     m_searchResult = m_module->Search(searchedText, searchType,
searchFlags, scope, 0, percentUpdate);
...
     if (scope)
          delete scope;

I don't think you want to delete m_searchResult ever.

	-Troy.





Joachim Ansorg wrote:
> 
> Hi Troy!
> 
> > This is good information.  I have placed a few new things in
> > swmodule.cpp:
> >  o A check to only call custom percentage function if the percentage
> > value is different than last.
> >  o An error check if the value is smaller than last.
> >
> > I was wondering if you could make it break and send me the output (only
> > the first few instances) that you receive.  Thanks!!!  I appreciate you
> > digging for this.
> 
> I broke it with BibleTime:
> Here's the output (I searche din the WEB module):
> 
> (BibleTime 1.0) Debug: 127 o/o
> Serious error: new percentage complete is less than previous value
> using vk? yes
> index: 10905
> highIndex: 8245
> Serious error: new percentage complete is less than previous value
> using vk? yes
> index: 10906
> highIndex: 8245
> Serious error: new percentage complete is less than previous value
> using vk? yes
> index: 10907
> highIndex: 8245
> Serious error: new percentage complete is less than previous value
> using vk? yes
> index: 10908
> highIndex: 8245
> Serious error: new percentage complete is less than previous value
> using vk? yes
> index: 10909
> highIndex: 8245
> Serious error: new percentage complete is less than previous value
> using vk? yes
> index: 10910
> highIndex: 8245
> 
> >               -Troy.
> >
> > PS.  Ideally if you could produce it with examples/cmdline/search, that
> > would be best for me.  Otherwise, I believe it might be a thread issue.
> 
> I can't break it with the example.
> 
> I hope thid does help,
> --Joachim