I'm using the same system as the Stray Toaster, so I'll chip in.
> fun -> 19 results
> fun () -> 0 results
> fun "" -> ParseException
On Fri Mar 7 06:33:30 2003, Otis Gospodnetic wrote:
> () and "" are special characters (in QueryParser realm). You could try
> escaping them with \. Make sure you use an Analyzer that doesn't strip
> that character though. WhitespaceAnalyzer won't strip them, for
> example.
That's not the problem. We were expecting [ fun () ] to produce the
same results as [ fun ]. I thought that a Term combined with an empty
Query should be the same as the Term alone. What I wasn't sure about
was if an empty Query was allowed.
The results with an empty phrase confused me more.
I had a look at the syntax explanation in the faq and assumed the three
examples above would parse as:
fun -> Query(Clause(BasicClause(Term("fun"))))
fun () -> Query(
Clause(BasicClause(Term("fun"))),
Clause(BasicClause(Query(Clause(BasicClause(Term(""))))))
)
fun "" -> Query(
Clause(BasicClause(Term("fun"))),
Clause(BasicClause(Phrase(Term(""))))
)
I was not sure if a Term could be empty, so I tried both. I would
expect [ fun () ] and [ fun "" ] to behave the same way: either they
both throw ParseException or both do nothing.
--
Marty
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]