elasticsearch,search,indexing,liferay,Java,elasticsearch,Search,Indexing,Liferay" /> elasticsearch,search,indexing,liferay,Java,elasticsearch,Search,Indexing,Liferay" />

Java 无法在索引中查看ElasticSearch创建的文档

Java 无法在索引中查看ElasticSearch创建的文档,java,elasticsearch,search,indexing,liferay,Java,elasticsearch,Search,Indexing,Liferay,我正在使用liferay 7.3.5并尝试创建elasticSearch。通过我在ElasticSearch的第一次体验,我尝试为数据库中的一个实体编制索引。我正确构建了搜索平台,并在特定节点内以远程模式使用。对于索引,我已经按照本教程中的步骤逐一进行了操作 此外,服务层中的索引处理也做到了这一点,它运行良好,在调试模式下,可以清楚地看到,条目被索引,转换为文档,并存储在与Liferay中的companyId相对应的特殊索引号中 我可以在搜索菜单的本地主机中看到该索引 问题是,当我在elast

我正在使用liferay 7.3.5并尝试创建elasticSearch。通过我在ElasticSearch的第一次体验,我尝试为数据库中的一个实体编制索引。我正确构建了搜索平台,并在特定节点内以远程模式使用。对于索引,我已经按照本教程中的步骤逐一进行了操作

此外,服务层中的索引处理也做到了这一点,它运行良好,在调试模式下,可以清楚地看到,条目被索引,转换为文档,并存储在与Liferay中的companyId相对应的特殊索引号中

我可以在搜索菜单的本地主机中看到该索引

问题是,当我在elasticsearch中使用Kibana或direkt在生成的索引中搜索时,我找不到自己的条目

这是我的elasticsearch配置

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: LiferayElasticsearchCluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-1
#
# Add custom attributes to the node:
#
node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.seed_hosts: ["127.0.0.1", "[::1]"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
一些查询,例如:

curl -H 'Content-Type: application/json' -X GET https://localhost:9200/index_name?pretty
仅显示索引中的基本内容,不会显示为索引实体创建的任何文档

这里是主要的索引内容

{
  "took" : 51,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 10000,
      "relation" : "gte"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "liferay-37710",
        "_type" : "LiferayDocumentType",
        "_id" : "37710_spellCheckWord_hpItPms3XD6+xRXITXem4Q==",
        "_score" : 1.0,
        "_source" : {
          "uid" : "37710_spellCheckWord_hpItPms3XD6+xRXITXem4Q==",
          "companyId" : "37710",
          "spellCheckWord_es_ES" : "Roma",
          "groupId" : "0",
          "languageId" : "es_ES",
          "priority" : "0.0",
          "type" : "spellChecker"
        }
      },
      {
        "_index" : "liferay-37710",
        "_type" : "LiferayDocumentType",
        "_id" : "37710_spellCheckWord_4eLyz9eWq/ExLH2UIXzyjA==",
        "_score" : 1.0,
        "_source" : {
          "uid" : "37710_spellCheckWord_4eLyz9eWq/ExLH2UIXzyjA==",
          "companyId" : "37710",
          "spellCheckWord_es_ES" : "nabla",
          "groupId" : "0",
          "languageId" : "es_ES",
          "priority" : "0.0",
          "type" : "spellChecker"
        }
      },
      {
        "_index" : "liferay-37710",
        "_type" : "LiferayDocumentType",
        "_id" : "37710_spellCheckWord_9HJwraB61aNCiyw34D9pKQ==",
        "_score" : 1.0,
        "_source" : {
          "uid" : "37710_spellCheckWord_9HJwraB61aNCiyw34D9pKQ==",
          "companyId" : "37710",
          "spellCheckWord_es_ES" : "Sancho",
          "groupId" : "0",
          "languageId" : "es_ES",
          "priority" : "0.0",
          "type" : "spellChecker"
        }
      },
      {
        "_index" : "liferay-37710",
        "_type" : "LiferayDocumentType",
        "_id" : "37710_spellCheckWord_0M8pwRYwBq1tdRsWqXXSkQ==",
        "_score" : 1.0,
        "_source" : {
          "uid" : "37710_spellCheckWord_0M8pwRYwBq1tdRsWqXXSkQ==",
          "companyId" : "37710",
          "spellCheckWord_es_ES" : "neonat�logo",
          "groupId" : "0",
          "languageId" : "es_ES",
          "priority" : "0.0",
          "type" : "spellChecker"
        }
      },
      {
        "_index" : "liferay-37710",
        "_type" : "LiferayDocumentType",
        "_id" : "37710_spellCheckWord_urh2RmIpestSVBkqxfajlg==",
        "_score" : 1.0,
        "_source" : {
          "uid" : "37710_spellCheckWord_urh2RmIpestSVBkqxfajlg==",
          "companyId" : "37710",
          "spellCheckWord_es_ES" : "naturalizar",
          "groupId" : "0",
          "languageId" : "es_ES",
          "priority" : "0.0",
          "type" : "spellChecker"
        }
      },
      {
        "_index" : "liferay-37710",
        "_type" : "LiferayDocumentType",
        "_id" : "37710_spellCheckWord_WQdpBH7oN5SfNEhPdkwBCQ==",
        "_score" : 1.0,
        "_source" : {
          "uid" : "37710_spellCheckWord_WQdpBH7oN5SfNEhPdkwBCQ==",
          "companyId" : "37710",
          "spellCheckWord_es_ES" : "Montesa",
          "groupId" : "0",
          "languageId" : "es_ES",
          "priority" : "0.0",
          "type" : "spellChecker"
        }
      },
      {
        "_index" : "liferay-37710",
        "_type" : "LiferayDocumentType",
        "_id" : "37710_spellCheckWord_9Zk1wxijkzSFKbhDYUvLmg==",
        "_score" : 1.0,
        "_source" : {
          "uid" : "37710_spellCheckWord_9Zk1wxijkzSFKbhDYUvLmg==",
          "companyId" : "37710",
          "spellCheckWord_es_ES" : "natral",
          "groupId" : "0",
          "languageId" : "es_ES",
          "priority" : "0.0",
          "type" : "spellChecker"
        }
      },
      {
        "_index" : "liferay-37710",
        "_type" : "LiferayDocumentType",
        "_id" : "37710_spellCheckWord_/iyA0D3o33rpBLGqAKA+iw==",
        "_score" : 1.0,
        "_source" : {
          "uid" : "37710_spellCheckWord_/iyA0D3o33rpBLGqAKA+iw==",
          "companyId" : "37710",
          "spellCheckWord_es_ES" : "nerviosismo",
          "groupId" : "0",
          "languageId" : "es_ES",
          "priority" : "0.0",
          "type" : "spellChecker"
        }
      },
      {
        "_index" : "liferay-37710",
        "_type" : "LiferayDocumentType",
        "_id" : "37710_spellCheckWord_MQkMexFs2h9y6qh9lOPvAQ==",
        "_score" : 1.0,
        "_source" : {
          "uid" : "37710_spellCheckWord_MQkMexFs2h9y6qh9lOPvAQ==",
          "companyId" : "37710",
          "spellCheckWord_es_ES" : "nat�o",
          "groupId" : "0",
          "languageId" : "es_ES",
          "priority" : "0.0",
          "type" : "spellChecker"
        }
      },
      {
        "_index" : "liferay-37710",
        "_type" : "LiferayDocumentType",
        "_id" : "37710_spellCheckWord_1QP9Sy8zifQSnSiRfVcvKg==",
        "_score" : 1.0,
        "_source" : {
          "uid" : "37710_spellCheckWord_1QP9Sy8zifQSnSiRfVcvKg==",
          "companyId" : "37710",
          "spellCheckWord_es_ES" : "narcolepsia",
          "groupId" : "0",
          "languageId" : "es_ES",
          "priority" : "0.0",
          "type" : "spellChecker"
        }
      }
    ]
  }
}
还有什么要做的吗


感谢您的帮助

我能够通过清除主索引的内容并重新索引实体来解决问题,因此旧的映射被删除,不再存在冲突。因此,文档保存在索引中。

GEThttps://localhost:9200/index_name?pretty
不会返回索引中的文档。您需要运行match_all查询,或者只需:
GEThttps://localhost:9200/index_name/_search?pretty
。请注意URL中的
\u search
,谢谢您的回答,但这并没有帮助,因为结果没有改变Archit粘贴的URL,它只返回前10个元素,您应该添加
&size=1000
参数以强制返回更多元素。您还可以尝试使用
q=groupId:
参数按groupId进行筛选。因此,例如,如果您
groupId=202103
,elasticsearch查询将是:
http://localhost:9200/_search?q=groupId:202103&pretty&size=100
@jorgediaz lr这不起作用。。。我的问题是没有找到任何创建的文档