[jsword-devel] Searching with headings
Troy A. Griffitts
scribe at crosswire.org
Wed Aug 15 12:34:49 MST 2012
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
> <mailto: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 <mailto:jsword-devel at crosswire.org>
> http://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/94490784/attachment-0001.html>
More information about the jsword-devel
mailing list