solr问题:如何让solr仅在xml中突出显示来响应
我不希望 solr 响应文档及其所有文本,因为它太长了; 我希望 solr 仅在 xml 中突出显示来进行响应。 我的英语不好。希望你能理解我。 有人可以帮助我吗?
I don't want solr to repond with document with all its text because it is too long;
I want solr to repond with only highlighting in xml.
My English is not well. Hope you would understand me.
Can someone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果包含 rows=0,则不会返回任何文档。
If you include rows=0, you won't get any document back.
从
fl
中删除您不需要的字段,Solr 将不会返回它。您仍然可以将该字段添加到突出显示配置中,Solr 将从该字段返回片段。如果没有生成片段,您还可以将 Solr 配置为返回一小部分字段数据。 (参见hl.maxAlternateFieldLength)Remove the field that you do not want from
fl
and Solr will not return it. You can still add that field to highlighting config and Solr will return snippets from the field. You can also configure Solr to return a small part of the field data if no snippets are generated. (Seehl.maxAlternateFieldLength
)这些建议都不适合我,但我确实得到了 SOLR 4.3 的解决方案。如果我的查询中没有 fl 参数,则返回所有字段。将 fl 设置为我正在查询的字段(在我的情况下,所有内容都被推入 attr_content)仍然返回整个文档。
我的最终解决方案是将 fl 查询参数设置为不存在的字段,如下所示:
None of these suggestions worked for me, but I did get a solution for SOLR 4.3. Without the fl parameter in my query, all fields were returned. Setting fl to the field I am querying (in my case, all content gets shoved into attr_content) still returned the entire document.
The final solution for me was to set the fl query parameter to a non-existent field, like so: