数据存储在elasticsearch中,但从kibana访问时不显示

发布于 2025-01-11 10:39:17 字数 1050 浏览 0 评论 0原文

我使用 Django 作为后端,Postgres 数据库和 Angular JS 作为前端。当我们从前端注册时,数据存储在 Elasticsearch 中。它存储在 Elasticsearch 中,因为计数显示了所有注册数据,但当我使用以下命令在 Kibana 中搜索时,它没有显示:

GET candidate/_search 

Kibana 中的输出:

{
  "took" : 3,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 16,
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "candidate",
        "_type" : "doc",
        "_id" : "705",
        "_score" : 1.0,
        "_source" : {
          "id" : 705,
          "user" : {
            "id" : 7005,
            "first_name" : "brain",
            "last_name" : "martine",
            "email" : "[email protected]",
            "employer_nm" : "A-1 hospitality",
            "property_owner" : "25hours Hotel Company"
          },

这里,总计数为 16,但它只显示我通过 Postman 添加的 10 条之前的数据。

I am using Django as a backend with Postgres database and Angular JS as a frontend. When we signup from frontend then the data stored in Elasticsearch. It is stored in Elasticsearch because counts show all signup data but it is not shown when I search in Kibana by using this command:

GET candidate/_search 

Output in Kibana:

{
  "took" : 3,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 16,
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "candidate",
        "_type" : "doc",
        "_id" : "705",
        "_score" : 1.0,
        "_source" : {
          "id" : 705,
          "user" : {
            "id" : 7005,
            "first_name" : "brain",
            "last_name" : "martine",
            "email" : "[email protected]",
            "employer_nm" : "A-1 hospitality",
            "property_owner" : "25hours Hotel Company"
          },

Here, the total count is 16, but it only shows 10 previous data which I added through Postman.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

提笔落墨 2025-01-18 10:39:17

Elasticsearch 默认只获取前 10 个结果,您可以使用 size 参数来获取更多文档。下面的示例将从您的索引中获取 100 个文档,因为当前有 16 个文档,因此它将获取 16 个。

GET candidate/_search?size=100

有关 Elasticsearch 文档

在此处输入图像描述

Elasticsearch by default fetch only the top 10 results, you can use size param to get more documents. Below example would fetch 100 documents from your index, as there are currently 16, Hence it would fetch 16.

GET candidate/_search?size=100

More info on Elasticsearch documentation

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文