WildcardQuery error in Solr

Question :

WildcardQuery error in Solr,

Answer :

I use solr to search for documents and when trying to search for documents using this query “id:*“, I get this query parser exception telling that it cannot parse the query with * or ? as the first character.

HTTP Status 400 - org.apache.lucene.queryParser.ParseException: Cannot parse 'id:*': '*' or '?' not allowed as first character in WildcardQuery    type Status report    message org.apache.lucene.queryParser.ParseException: Cannot parse 'id:*': '*' or '?' not allowed as first character in WildcardQuery    description The request sent by the client was syntactically incorrect (org.apache.lucene.queryParser.ParseException: Cannot parse 'id:*': '*' or '?' not allowed as first character in WildcardQuery).  

Is there any patch for getting this to work with just * ? Or is it very costly to do such a query?

Read More  How to stop IIS asking authentication for default website on localhost

,

If you want all documents, do a query on *:*

If you want all documents with a certain field (e.g. id) try id:[* TO *]

That’s the answer WildcardQuery error in Solr, Hope this helps those looking for an answer. Then we suggest to do a search for the next question and find the answer only on our site.

Disclaimer :

The answers provided above are only to be used to guide the learning process. The questions above are open-ended questions, meaning that many answers are not fixed as above. I hope this article can be useful, Thank you

Read More  mod_rewrite to alias one file suffix type to another