Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lucene query parser cannot parse wildcard queries #61

Closed
rosequ opened this issue May 31, 2016 · 1 comment
Closed

Lucene query parser cannot parse wildcard queries #61

rosequ opened this issue May 31, 2016 · 1 comment

Comments

@rosequ
Copy link
Member

rosequ commented May 31, 2016

Lucene query parser gives the following error if the query has wildcard characters in it:
'*' or '?' not allowed as first character in WildcardQuery
Ex: Cannot parse 'where is the Eldorado Casino in Reno ?': '*' or '?' not allowed as first character in WildcardQuery.

@rosequ rosequ changed the title Lucene query parser cannot parse wildcard query Lucene query parser cannot parse wildcard queries May 31, 2016
@iorixxx
Copy link
Contributor

iorixxx commented May 31, 2016

There are two options here:

  • Escape the characters that are part of the query syntax using queryparser.classic.QueryParserBase#escape
  • Tokenize the query string and create the Lucene Query object by your self without a query parser.

@rosequ rosequ closed this as completed Nov 23, 2016
@castorini castorini locked as resolved and limited conversation to collaborators Nov 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants