You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Pranav Prakash <pr...@gmail.com> on 2011/08/10 15:34:50 UTC

How come this query string starts with wildcard?

While going through my error logs of Solr, i found that a user had fired a
query - jawapan ujian bulanan thn 4 (bahasa melayu). This was converted to
following for autosuggest purposes -
jawapan?ujian?bulanan?thn?4?(bahasa?melayu)* by the javascript code. Solr
threw the exception

Cannot parse 'jawapan?ujian?bulanan?thn?4?(bahasa?melayu)*': '*' or
'?' not allowed as first character in WildcardQuery

How come this query string begins with wildcard character?

When I changed the query to remove brackets, everything went smooth.
There were no results, because probably my search index didn't had
any.


*Pranav Prakash*

"temet nosce"

Twitter <http://twitter.com/pranavprakash> | Blog <http://blog.myblive.com> |
Google <http://www.google.com/profiles/pranny>

RE: How come this query string starts with wildcard?

Posted by Michael Ryan <mr...@moreover.com>.
I think this is because ")" is treated as a token delimiter. So "(foo)bar" is treated the same as "(foo) bar" (that is, bar is treated as a separate word). So "(foo)*" is really parsed as "(foo) *" and thus the * is treated as the start of a new word.

-Michael