Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WildcardQuery error in Solr

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?

like image 710
cnu Avatar asked Aug 19 '08 10:08

cnu


1 Answers

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

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

like image 83
Daniel Papasian Avatar answered Oct 13 '22 23:10

Daniel Papasian