[jsword-devel] Searching with headings

Chris Burrell chris at burrell.me.uk
Wed Aug 15 12:57:24 MST 2012


Hi

Thanks for the comments so far. I'v
Martin, the ESV hasFeature returns that it does in fact return true. Also,
the problem with the KJV is that it does contain any headings apart from in
the Psalms for example (like Psalm 1).

Troy, I tried with and without the leading * but same happens and it works
in other searches.

I've found in the end that it seems to have only indexed the canonical
headings. I.e. I get back results for heading:psalm (82 results, e.g. Ps
3:1 "A Psalm of David, when he fled from Absalom his son"). Both OSIS
fragments are "title".

<title subType="x-preverse" type="section">Jesus Walks on the Water</title>
<title canonical="true" subType="x-preverse" type="section">A Psalm of
David, when he fled from Absalom his son.</title>

However, I see in here getHeadings() that there is a call to
getCanonicalContent which basically returns immediately if the content that
is passed is not canonical.

Any particular reason why that is for indexing headings?
Chris



On 15 August 2012 20:34, Troy A. Griffitts <scribe at crosswire.org> wrote:

>  I also don't believe lucene allows * prefixes on words-- only postfix.
> Have you tried simply:
>
> heading:water
>
>
>
>
> On 08/15/2012 09:30 PM, Martin Denham wrote:
>
> I think there might be a problem with index creation code or .conf files.
>  Comparing the Strongs index creation code (which works) with Headings:
>
>  In LuceneIndex you see:
>          boolean hasStrongs =
> book.getBookMetaData().hasFeature(FeatureType.STRONGS_NUMBERS);
>         boolean hasHeadings =
> book.getBookMetaData().hasFeature(FeatureType.HEADINGS);
>
>  Then in kjv.conf you see various attributes relating to Strongs and
> Headings but I believe the 3rd one is the one used by the above code in
> LuceneIndex::
>
>  GlobalOptionFilter=OSISStrongs
>  GlobalOptionFilter=OSISHeadings
>  Feature=StrongsNumbers
>
>
>  However, in a module that contains headings like ESV in esv.conf there
> is no
>
>  Feature=Headings
>
>
>  So it may be that the headings do not make it into the index because of
> the following in LuceneIndex:
>                  if (hasHeadings) {
>                     addField(doc, headingField,
> OSISUtil.getHeadings(osis));
>                 }
>
>  but DM will be able to confirm if that is the problem.
>
>  Martin
>
> On 15 August 2012 20:06, Chris Burrell <chris at burrell.me.uk> wrote:
>
>> Hi all
>>
>>  I'm trying to search the headings of a particular book (say ESV).
>>
>>  I'm using the following query "heading:*water*" which I was hoping
>> should match "Jesus walks on Water" (case doesn't seem to make a
>> difference).
>>
>>  My code is simply: bible.find(new DefaultSearchRequest(query,
>> modifier));
>>
>>  Has anyone else managed to get this working?
>>
>>  Chris
>>
>>
>>
>>  final long start = System.currentTimeMillis();
>>
>>          final DefaultSearchModifier modifier = new
>> DefaultSearchModifier();
>>         modifier.setRanked(ranked);
>>         modifier.setMaxResults(MAX_RESULTS);
>>
>>          final Book bible =
>> this.av11nService.getBookFromVersion(version);
>>
>>          try {
>>
>>              final Key results;
>>
>>              // TODO JS-228 raised for thread-safety
>>             synchronized (this) {
>>                 results = bible.find(new DefaultSearchRequest(query,
>> modifier));
>>             }
>>
>>              LOGGER.debug("[{}] verses found.",
>> results.getCardinality());
>>
>>              if (ranked) {
>>                 rankAndTrimResults(results, MAX_RESULTS);
>>             } else {
>>                 trimResults(results, MAX_RESULTS);
>>             }
>>             LOGGER.debug("Trimmed down to [{}].",
>> results.getCardinality());
>>
>>              final long startRefs = System.currentTimeMillis();
>>             final List<SearchEntry> resultPassages =
>> getPassagesForResults(bible, results);
>>             final long endRefs = System.currentTimeMillis();
>>
>>              return getSearchResult(query, start, startRefs, endRefs,
>> resultPassages);
>>         } catch (final BookException e) {
>>             throw new StepInternalException("Unable to search for " +
>> query + " with Bible " + version, e);
>>         }
>>
>> _______________________________________________
>> jsword-devel mailing list
>> jsword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/jsword-devel
>>
>>
>
>
> _______________________________________________
> jsword-devel mailing listjsword-devel at crosswire.orghttp://www.crosswire.org/mailman/listinfo/jsword-devel
>
>
>
> _______________________________________________
> jsword-devel mailing list
> jsword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/jsword-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20120815/9032e6f5/attachment-0001.html>


More information about the jsword-devel mailing list