Solr中的WildcardQuery错误 [英] WildcardQuery error in Solr

查看:279
本文介绍了Solr中的WildcardQuery错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用solr搜索文档,并且尝试使用此查询"id:*"搜索文档时,出现此查询解析器异常,告知它无法使用*或?解析查询.作为第一个字符.

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?

推荐答案

如果要获取所有文档,请在*:*

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

如果您希望所有带有特定字段(例如id)的文档,请尝试id:[* TO *]

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

这篇关于Solr中的WildcardQuery错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆