[jsword-devel] Searching with headings

Chris Burrell chris at burrell.me.uk
Wed Aug 15 12:06:16 MST 2012


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);
        }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/jsword-devel/attachments/20120815/536be92b/attachment.html>


More information about the jsword-devel mailing list