lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Hostetter <hossman_luc...@fucit.org>
Subject Re: Error tolerant query parsing
Date Wed, 29 Jun 2005 06:57:40 GMT

There's two ways you can make query parsing be more tolerant:

1) write a more tolerate parser that never throws exceptions

2) wrap the existing query parser in code that inspects any caught
ParseExceptions and ties to modifiy the string to fix it.

...I've never tried either, but a rule based approach for dealing with #2
should possible given the API of ParseException if the set of rules you
want to deal with is simple enough (ie: just close any open quotes)

http://lucene.apache.org/java/docs/api/org/apache/lucene/queryParser/ParseException.html


: Date: Tue, 28 Jun 2005 21:19:05 -0700
: From: Marvin Humphrey <marvin@rectangular.com>
: Reply-To: java-user@lucene.apache.org
: To: java-user@lucene.apache.org
: Subject: Error tolerant query parsing
:
: Greetings,
:
: Is it possible to have Lucene parse malformed queries?  For instance,
: is there a way to have this query...
:
: art museums "new york city
:
: ... return results for ...
:
: art museums "new york city"
:
: ... or is that just a parse error, end of story?
:
: It's a DWIM* thing.
:
: --
: Marvin Humphrey
:
: * DWIM: Do What I Mean
:
:
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
: For additional commands, e-mail: java-user-help@lucene.apache.org
:



-Hoss


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message