[jsword-devel] New Search Syntax

DM Smith dmsmith555 at gmail.com
Mon Apr 11 15:53:01 MST 2005


I am thinking of the following for a new search syntax:
SearchRequest -> LuceneSearch
                        or CompoundSearch
                        or RangeRequest LuceneSearch
                        or RangeRequest CompoundSearch

LuceneSearch  -> defined by lucene, not repeated here

CompoundSearch -> LuceneSearch Blur LuceneSearch

RangeRequest     ->  [ RangeNotation ] /* all these verses are ORed with 
the rest */
                          or +[ RangeNotation ] /* the search is 
retricted to these verses */
                          or  -[ RangeNotation ] /* these verses are 
removed from the search results */

RangeNotation -> anything that JSword can handle as a range

Blur                  -> ~   /* Uses the blur size as given in options */
                        or ~N /* Finds verses within N verses of each 
other */
(Currently a ~ b finds b near a. I think this is counter intuitive. 
Should it be the other way?)

Things to note:
A search can have at most one RangeRequest. This actually will be a 
search modifier applied the results of the search.
A search can have at most one Blur.
Each part of the search request is expected to be separated by 
whitespace from the others.

While the search syntax can be defined recursively, I think such 
complexity does not add a lot of value for Blur and RangeRestrictions.

Without recursion in this syntax, a trivial parser can be written.

One further thing, Lucene uses English connectors. Should we entertain 
the internationalization of these?


More information about the jsword-devel mailing list