Solr“实时"获取-如何包含“文本"字段? [英] Solr "real time" get - How to include 'text' field?

查看:97
本文介绍了Solr“实时"获取-如何包含“文本"字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

执行实时"获取时是否可以检索文本"字段?

Is it possible to retrieve the "text" field when performing a "real time" get ?

当我执行/get请求时,返回的json不包含文本"字段的内容.

When I perfom a /get request the returned json does not contain the content of the 'text' field.

当我执行搜索(/选择请求)时,返回的json确实包含文本"字段的内容.

When I perform a search (/select request) the returned json does contain the content of the 'text' field.

下面是一个ID为123的示例:

Here is an example where the id is 123:

搜索请求 http://localhost:8984/solr/real/select?q = id:123 返回:

{
  "responseHeader":{
    "zkConnected":true,
    "status":0,
    "QTime":4,
    "params":{
      "q":"id:123"}},
  "response":{"numFound":1,"start":0,"maxScore":9.250275,"docs":[
      {
        "id":"123",
        "filename":"SKMBT_C45212120410351.pdf",
        "file_size":1793774.0,
        "archive_date":"2012-12-04T08:38:12Z",
        "content_type":["text/plain; charset=UTF-8"],
        "_version_":1611231085639761920,
        "text":[TEXT_CONTENT]}]
  }
}

现在获取请求: http://localhost:8984/solr/real/get?id = 123 返回:

{
  "doc":
  {
    "id":"123",
    "filename":"SKMBT_C45212120410351.pdf",
    "file_size":1793774.0,
    "archive_date":"2012-12-04T08:38:12Z",
    "content_type":["text/plain; charset=UTF-8"],
    "_version_":1611231085639761920
  }
}

如您所见,文本"字段缺失.

As you can see the 'text' field is missing.

/get请求响应中是否可以包含文本"字段?

Is it possible to have the 'text' field included in the /get request response ?

请注意,在架构中,文本"字段已正确标记为已存储:

Note that in the schema the 'text' field is correctly marked as stored:

<field name="text" type="text_general" indexed="true" stored="true"/>

推荐答案

实时获取

按照上面的链接,实时获取依赖于更新日志功能.因此,您将获得该ID的最新文档.因此,如果您上次建立索引的过程缺少 text 字段,则实时获取不会返回该字段.

As per above link Real Time Get relies on the update log feature. So, you will get the latest document for that id. So, If your last indexing process is missing text field then real-time get wont return that field.

检查以下屏幕截图.

实时获取和更新屏幕截图

这篇关于Solr“实时"获取-如何包含“文本"字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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