[jsword-devel] Search again (part 2 - Code design)

Joe Walker joseph.walker at gmail.com
Sun Sep 26 14:53:00 MST 2004


Hi,

Given the above design, it strikes me that we want to have control
over the search syntax. If we simply use a Lucene QueryParser to
dictate our search syntax then we will find that we can't make G4356
mean "strongs greek number 4356", we would need to use
"strongs-greek:4356" because the : is an important part of the Lucene
syntax.

Also letting Lucene (or any other search engine) control our search
syntax means swapping search engine affects all our users. If we do
the parsing then it doesn't, and we have a query parser already so we
can carry on  using it. This does not mean that we have to abandon
Lucene, just that we use a FieldQuery rather than a QueryParser (in
Lucene speak).

Now this was the route that I was originally going down execpt that
making our Matcher code work on top of Lucene is hard because one
thing a search Index needs to be able to do (to support Matcher) is to
find all words that start with some string. This is to allow stemming
(to make Love, Loving, Loves, etc all match Lover, for example).
However the real requirement for the Matcher is a kind of Thesaurus
interface - "get me all the words that mean the same as X".

So my current plan is to have a Thesaurus interface that we either
implement by returning the word that we were sent alone, or if I can
work out how to use Lucene more, by using more info from Lucene.

Joe.


More information about the jsword-devel mailing list