lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf Hettesheimer" <ralf.hetteshei...@blue-order.com>
Subject AW: [Bug 8307] - WildcardQuery broken for '?' characters in query
Date Fri, 17 May 2002 06:37:13 GMT
Hello,

> -----Ursprungliche Nachricht-----
> Von: Brian Goetz [mailto:brian@quiotix.com]
> Gesendet: Donnerstag, 16. Mai 2002 23:10
> An: Lucene Developers List
> Betreff: Re: [Bug 8307] - WildcardQuery broken for '?' characters in
> query
>
>
> > I have looked into the QueryParser code and the problem
> appears to be the
> > differentiation between a TERM and a WILDTERM. If a term
> contains a question
> > mark it is not treated as a WILDTERM but as a TERM because
> the question mark
> > is a letter that can be part of a TERM.
>
> This should be addressed in the unit test for the query parser.  Can
> you provide me with examples of the queries that are parsed
> incorrectly?

As I said I had attached a version of TestWildCard including some queries
that fail. The essential code is:

	try {
		Query query5 = QueryParser.parse("m?tal", "body", new SimpleAnalyzer());
		Query query6 = QueryParser.parse("metal?", "body", new SimpleAnalyzer());
		Query query7 = QueryParser.parse("metals?", "body", new SimpleAnalyzer());
		Query query8 = QueryParser.parse("m?t?ls", "body", new SimpleAnalyzer());

		result = searcher.search(query5);
		assertEquals(1, result.length());

		result = searcher.search(query6);
		assertEquals(2, result.length());

		result = searcher.search(query7);
		assertEquals(1, result.length());

		result = searcher.search(query8);
		assertEquals(3, result.length());
	} catch (ParseException e) {
	}

> > Another question concerning the QueryParser. I made another change
> > to the QueryParser (QueryParser2.jj) that allows to search for terms
> > starting with a wildcard. Is there any reason why Lucene does not
> > support this by default?
>
> This was deliberate.  It would be a performance disaster.

Are there any performance numbers that can underline this?

Thanks
Ralf


--
To unsubscribe, e-mail:   <mailto:lucene-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-dev-help@jakarta.apache.org>


Mime
View raw message