[bt-devel] save search analysis - updated

mark bt-devel@crosswire.org
Sun, 17 Feb 2002 22:55:09 -0500


Hi Joachim!

I just couldn't leave well enough alone.. :)

I saw the code for parsing the keys mentioned below (thanks, this was 
very helpfull).  I am now able to get the text scope kind of like this:

-----------------------------
Search Text : god
Search Type : Multiple Words
Search Scope:	Genesis 1:1 - Exodus 40:38
		John 1:1 - Revelation of John 22:21
		Joshua 1:1 - Esther 10:3
-----------------------------

The issue is that the results aren't being displayed as they should.  I 
used the scope above (per your suggestion below), and did a search for 
"god" in the AKJV, ASV, ACV and a couple other modules.  The search 
analysis tab correctly displays the results for the Gen-Exo and John-Rev 
results, but doesn't show anything for Jos-Est.  I verified with a 
separate search that "god" should appear someplace in Jos-Est.  So, 
bottom line is:
	1. the save search analysis to disk works just like the search analysis tab.
	2. there's a bug in both where if the scope has a range that's out of 
order, it won't be displayed.  this is only an issue when scope is used 
on a search, and the scope has multiple parts, and one of the parts is 
out of order.

I figured it safe to check in the changes I made to display the search 
scope since that's working fine.  I'll look into what can potentially be 
done to resolve this out of order scope issue.  If there's any 
suggestions out there ...


~mark

Joachim Ansorg wrote:
> Hi Mark!
> 
> Sorry for the really late answer!
> 
> 
>>for some reason, when i'm getting the scope back, it's only returning a
>>list of one key.  if i set the scope to be "History", the only key in
>>the list is Joshua 1:1 (the first key of the expected list).
>>
> 
> You are right. You get only the first part of the scope back. 
> The original scope of "history" is "Jos - Est". But you get only Joshua back.
> I needed some thinnking about this.
> 
> 
> You know, the scope is a list of keys. These keys might be VerseKey objects 
> if they are used for a Bible or a Commentary. But each VerseKey may have a 
> LowerBound() and an UpperBound(). 
> For history this is:
> 	VerseKey::LowerBound() of the first element returns Joshua 1:1
> 	VerseKey::UpperBound() of the first element returns the last verse of Ester
> 
> Have a look at CSwordModuleSearch::scope(), I added there some test to parse 
> the scope key. I hope this helps you to understand the structure of the scope.
> 
> Note, that a scope may have more than one element. An example for this might 
> be "Gen-Exo; John-Rev; Jos-Est". This is a scope with three elements, each 
> with lower and upper bound.
> 
> 
> Joachim
> 
> 
>