: Indeed - I assumed that only the "+" and "-" characters had any
: special meaning when parsing dismax queries and that all other content
: would be treated just as keywords.  That seems to be how it's
: described in the dismax documentation?

The dirty little secret of hte dismax parser is that i was an idiot when i 
wrote it.

I was working on project that needed a parser that would support +/-, and 
wanted to try the DisjunctionMaxQuery expanstion of the terms that 
DisMaxParser now supports.  

I started by attempting to tackle the DisjunctionMaxQuery expantion in a 
subclass of the existing QueryParser with every intention of throwing it 
away once it was working. This was because i needed a quick proof of 
concept that demonstrated the dismax query structures produced were 
actually useful, so far i'd only tested a few hardcoded example queries, 
and i needed the parser support so i could run some regression tests over 
existing *WELL FORMED* queries to compare the relevancy results.

It worked great: i successfully demonstrated to the right people that the 
query structures made sense for all our use cases.  So then i put a lower 
priority item on my todo list / schedule to figure out the "right" way to 
implement a DisMaxParser so i wasn't stuck with any of the error code 
paths in the QueryParser superclass.

I'm not sure if i was really tired when i finally got to looking at it, or 
if i was just really distracted, but i distinctly remember testing queries 
that had "and" and "or" in them and seeing them get parsed the way i 
wanted: the words were treated as litterals and incorporated into the 
DisjunctionMaxQuery structure. So i guess i assumed something about how i 
subclassed QUeryParser was bypassing the normal and/or logic, and i 
decided by quick and dirty subclass would work well enough.

The key thing to note here is that i remember testing "and" and "or" ... 
not "AND" and "OR" ... for some reason or another i was totally brain dead 
and tested the wrong thing.  had i tested the right thing, i probably 
would have decided i needed to write a new parser from scratch, and had 
the time to work it into hte project schedule.

alas: 20/20 hindsight.



-Hoss

Reply via email to