我正在使用liferay 7.3.5并尝试创建elasticSearch。通过我在ElasticSearch的第一次体验,我试图为数据库中的一个实体编制索引。我正确构建了搜索平台,并在特定节点内以远程模式使用。对于索引,我遵循了本教程中的一个接一个步骤
创建留言簿索引器
服务层的索引处理也做到了,它工作正常,在调试模式下,这可以清楚地看到,条目被索引,转换成文档,并存储在Liferay中对应于公司ID的特殊索引号中。
我可以在搜索菜单的本地主机中看到该索引。
问题是,当我在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"
}
}
]
}
}
还有什么要做的吗?
谢谢你的帮助
我能够通过清除主索引的内容并重新索引实体来解决这个问题,因此旧的映射被删除,不再存在冲突。因此,文档保存在索引中。
由于最近没有使用,我在Heroku上重新安装了我的盆景Elasticsearch插件。以前它工作得很好,但现在我在rails控制台中键入以下内容时: 我收到以下错误: Elasticsearch::Transport::Transport::Errors::BadRequest([400]{“error”:{“root\u cause”:[{“type”:“非法的\u参数\u异常”,“原因”:“除
我正在阅读文档,碰巧阅读了多个索引的创建和在多个索引上搜索的能力,以及在Elasticsearch中搜索特定搜索的可能性。 例如,我有两个索引,如释放区和工作区。我可以通过给http://localhost:9200/_search?pretty=true搜索,这将在所有索引中搜索 我可以专门搜索http://localhost:9200/releasedArea,工作区/\u搜索?漂亮=真。 因
本文向大家介绍MySQL查看、创建和删除索引的方法,包括了MySQL查看、创建和删除索引的方法的使用技巧和注意事项,需要的朋友参考一下 本文实例讲述了MySQL查看、创建和删除索引的方法。分享给大家供大家参考。具体如下: 1.索引作用 在索引列上,除了上面提到的有序查找之外,数据库利用各种各样的快速定位技术,能够大大提高查询效率。特别是当数据量非常大,查询涉及多个表时,使用索引往往能使查询速度加快
我对Elasticsearch完全陌生 我知道elasticsearch的索引不是mongobd的索引,它们就像mongodb的集合 我在elasticsearch中有一些索引(相当于MongoDB的集合),我想确保其中的特定字段将被索引(检索它们的速度将得到提高等等)。 我该怎么做? 在mongoDB中,它非常简单,因为我可以在集合上使用createindex()和ensureindex()方法
我正在设置Filebeat将日志发送到Elasticsearch。这是我的: 我有这个文件: 我期待着这份日志被发送到Elasticsearch。Elasticsearch在localhost的Docker容器中运行,地址为9200。 当我运行filebeat(Docker)时,Elasticsearch中不会创建索引。所以,在基巴纳,我没有看到任何数据。 为什么?Filebeat不应该自动创建索
问题内容: 我在ElasticSearch和Rails时遇到问题,由于attr_protected,其中一些数据未正确索引。Elastic Search在哪里存储索引数据?检查实际的索引数据是否错误将很有用。 检查映射对您没有帮助,将列出该字段。 问题答案: 探索您的ElasticSearch集群的最简单方法可能是使用elasticsearch -head。 您可以通过以下方式安装它: 然后(假设