lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marty Pauley <marty+luc...@kasei.com>
Subject Re: Unusual query results
Date Fri, 07 Mar 2003 16:22:39 GMT

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: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message