使用 fq 参数返回不同的文档字段
我正在 Solr Server 上搜索索引 &由其他人配置。
更改 fq 参数时,我收到不同的文档字段。
在搜索时,
q=业务管理
fq=type:Insitute
returns different document fields on searching the following and above
q=业务管理
fq=type:课程
我无法找出原因。
请提供建议。
I am searching on Solr Server indexed & configured by other person.
I am getting different document fields when changing the fq parameter.
On searching,
q=Business Management
fq=type:Insitute
returns different document fields on searching the following and above
q=Business Management
fq=type:Courses
I could not figure out the reason.
Kindly Advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Solr 返回文档中与查询匹配的存储字段。您可以通过
fl
参数过滤这些字段,但它看来你没有从你的问题中使用它。您可以检查solrconfig.xml
中是否有特定的fl
默认参数,无论如何这适用于每个文档。检查
schema.xml
中fields
元素内的内容。某些字段应具有属性required=true
。这意味着每个文档都需要它们,并且 Solr 不接受没有它们值的文档。这些必填字段是您必须始终从 Solr 返回的唯一字段,而您不知道有多少文档已填写或未填写可选字段。我想如果您通过fq
进行过滤,您会收到不同的文档,其中没有填写相同的可选字段。Solr returns the stored fields you have within the documents that match the query. You can filter those fields through the
fl
parameter, but it doesn't seem you're using it from your question. You could check if you have a specificfl
default parameter in yoursolrconfig.xml
, anyway this would work for every document.Check what you have inside the
fields
element in yourschema.xml
. Some of the fields should have the attributerequired=true
. This means they are required for every document and Solr doesn't accept a document without a value for them. Those required fields are the only fields you must always have back from Solr, while you don't know how many of your documents have an optional field filled in or not. I guess if you filter throughfq
you receive different documents, which don't have the same optional fields filled in.您使用什么请求处理程序?使用什么 fl 参数??
Solr 将返回所有标记为存储并由 fl 参数指定的字段。
fl 参数 默认情况下返回文档的所有字段。
但是,字段需要具有值。
因此,如果某些文档具有某些字段的值,而其他字段没有值,则这些字段不会随您的查询一起返回,这就是为什么您可能会看到查询返回的字段存在差异,具体取决于文档和具有以下值的字段:它。
What request handler are you using ?? with what fl parameter ??
Solr would return all the fields marked as stored and specified by the fl parameter.
fl parameter by default returns all the fields for the document.
However, the fields needs to have the values.
So if some of the documents have values for some fields and not others, these fields would not be returned with your query and that's why you may be seeing a difference in the fields returned for the queries depending upon the documents and the fields with values in it.