Mailing List Archive

Brackets in query syntax?
Are brackets, [ and ], legal in a query?
If so, do they have some special meaning?
If not, are there other "illegal" characters as well?

Parsing the query syntax, "[]", causes the following error:

Lexical error at line 1, column 3. Encountered: <EOF> after : "[]"
org.apache.lucene.queryParser.TokenMgrError: Lexical error at line 1, column
3. Encountered: <EOF> after : "[]"
at
org.apache.lucene.queryParser.QueryParserTokenManager.getNextToken(Unknown
Source)
at org.apache.lucene.queryParser.QueryParser.jj_ntk(Unknown Source)
at org.apache.lucene.queryParser.QueryParser.Modifiers(Unknown
Source)
at org.apache.lucene.queryParser.QueryParser.Query(Unknown Source)
at org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
at org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)

I am using QueryParser and the StandardAnalyzer to parse the query string.

Any help would be appreciate.
Paul

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: Brackets in query syntax? [ In reply to ]
[ and ] are used for RangeQuery. They indicate an inclusive range. For
example: "name:[adam-scott]"

> -----Original Message-----
> From: Paul Friedman [mailto:pfriedman@macromedia.com]
> Sent: Wednesday, October 31, 2001 2:03 PM
> To: 'lucene-user@jakarta.apache.org'
> Subject: Brackets in query syntax?
>
>
> Are brackets, [ and ], legal in a query?
> If so, do they have some special meaning?
> If not, are there other "illegal" characters as well?
>
> Parsing the query syntax, "[]", causes the following error:
>
> Lexical error at line 1, column 3. Encountered: <EOF> after : "[]"
> org.apache.lucene.queryParser.TokenMgrError: Lexical error at
> line 1, column
> 3. Encountered: <EOF> after : "[]"
> at
> org.apache.lucene.queryParser.QueryParserTokenManager.getNextT
> oken(Unknown
> Source)
> at
> org.apache.lucene.queryParser.QueryParser.jj_ntk(Unknown Source)
> at org.apache.lucene.queryParser.QueryParser.Modifiers(Unknown
> Source)
> at
> org.apache.lucene.queryParser.QueryParser.Query(Unknown Source)
> at
> org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
> at
> org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
>
> I am using QueryParser and the StandardAnalyzer to parse the
> query string.
>
> Any help would be appreciate.
> Paul
>
> --
> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>
RE: Brackets in query syntax? [ In reply to ]
Thanks, I didn't see anything about the range query in the syntax BNF.

In regards to the exception, I would expect that searching on the query "[]"
or "name:[]" would either find all documents or no documents, not throw an
exception?


-----Original Message-----
From: Scott Ganyo [mailto:scott.ganyo@eTapestry.com]
Sent: Thursday, November 01, 2001 7:39 AM
To: 'Lucene Users List'
Subject: RE: Brackets in query syntax?


[ and ] are used for RangeQuery. They indicate an inclusive range. For
example: "name:[adam-scott]"

> -----Original Message-----
> From: Paul Friedman [mailto:pfriedman@macromedia.com]
> Sent: Wednesday, October 31, 2001 2:03 PM
> To: 'lucene-user@jakarta.apache.org'
> Subject: Brackets in query syntax?
>
>
> Are brackets, [ and ], legal in a query?
> If so, do they have some special meaning?
> If not, are there other "illegal" characters as well?
>
> Parsing the query syntax, "[]", causes the following error:
>
> Lexical error at line 1, column 3. Encountered: <EOF> after : "[]"
> org.apache.lucene.queryParser.TokenMgrError: Lexical error at
> line 1, column
> 3. Encountered: <EOF> after : "[]"
> at
> org.apache.lucene.queryParser.QueryParserTokenManager.getNextT
> oken(Unknown
> Source)
> at
> org.apache.lucene.queryParser.QueryParser.jj_ntk(Unknown Source)
> at org.apache.lucene.queryParser.QueryParser.Modifiers(Unknown
> Source)
> at
> org.apache.lucene.queryParser.QueryParser.Query(Unknown Source)
> at
> org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
> at
> org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
>
> I am using QueryParser and the StandardAnalyzer to parse the
> query string.
>
> Any help would be appreciate.
> Paul
>
> --
> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail: <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>
RE: Brackets in query syntax? [ In reply to ]
Sure, that would make sense to me...

> -----Original Message-----
> From: Paul Friedman [mailto:pfriedman@macromedia.com]
> Sent: Thursday, November 01, 2001 9:13 AM
> To: 'Lucene Users List'
> Subject: RE: Brackets in query syntax?
>
>
> Thanks, I didn't see anything about the range query in the syntax BNF.
>
> In regards to the exception, I would expect that searching on
> the query "[]"
> or "name:[]" would either find all documents or no documents,
> not throw an
> exception?
>
>
> -----Original Message-----
> From: Scott Ganyo [mailto:scott.ganyo@eTapestry.com]
> Sent: Thursday, November 01, 2001 7:39 AM
> To: 'Lucene Users List'
> Subject: RE: Brackets in query syntax?
>
>
> [ and ] are used for RangeQuery. They indicate an inclusive
> range. For
> example: "name:[adam-scott]"
>
> > -----Original Message-----
> > From: Paul Friedman [mailto:pfriedman@macromedia.com]
> > Sent: Wednesday, October 31, 2001 2:03 PM
> > To: 'lucene-user@jakarta.apache.org'
> > Subject: Brackets in query syntax?
> >
> >
> > Are brackets, [ and ], legal in a query?
> > If so, do they have some special meaning?
> > If not, are there other "illegal" characters as well?
> >
> > Parsing the query syntax, "[]", causes the following error:
> >
> > Lexical error at line 1, column 3. Encountered: <EOF> after : "[]"
> > org.apache.lucene.queryParser.TokenMgrError: Lexical error at
> > line 1, column
> > 3. Encountered: <EOF> after : "[]"
> > at
> > org.apache.lucene.queryParser.QueryParserTokenManager.getNextT
> > oken(Unknown
> > Source)
> > at
> > org.apache.lucene.queryParser.QueryParser.jj_ntk(Unknown Source)
> > at org.apache.lucene.queryParser.QueryParser.Modifiers(Unknown
> > Source)
> > at
> > org.apache.lucene.queryParser.QueryParser.Query(Unknown Source)
> > at
> > org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
> > at
> > org.apache.lucene.queryParser.QueryParser.parse(Unknown Source)
> >
> > I am using QueryParser and the StandardAnalyzer to parse the
> > query string.
> >
> > Any help would be appreciate.
> > Paul
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:lucene-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:lucene-user-help@jakarta.apache.org>
>
> --
> To unsubscribe, e-mail:
<mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:lucene-user-help@jakarta.apache.org>