【问题标题】:index not found exception in laravel elastic search using scout package使用 scout 包在 laravel 弹性搜索中找不到索引异常
【发布时间】:2021-08-16 19:15:51
【问题描述】:

我已经安装了 tamayo/laravel-scout-elastic laravel 包,并且我确实导入了我的产品表记录,但是每当我搜索任何内容时,我都会收到“未找到索引异常”。下面是我对 scout.php 文件的配置

`'elasticsearch' => [

    'index' => env('ELASTICSEARCH_INDEX', 'marketplace'),

    'hosts' => [
        env('ELASTICSEARCH_HOST', 'http://localhost:9200'),
    ],
],`

当我做curl 'localhost:9200/marketplace/_mapping?pretty'时,我得到了以下回复。

`{

  "error" : {

"root_cause" : [ {

  "type" : "index_not_found_exception",

  "reason" : "no such index",

  "resource.type" : "index_or_alias",

  "resource.id" : "marketplace",

  "index" : "marketplace"

} ],

"type" : "index_not_found_exception",

"reason" : "no such index",

"resource.type" : "index_or_alias",

"resource.id" : "marketplace",

"index" : "marketplace"

  },

  "status" : 404

}`

我错过了什么吗?任何帮助将不胜感激。

【问题讨论】:

    标签: php laravel elasticsearch laravel-scout


    【解决方案1】:

    您是否通过 URL http://localhost:9200/marketplace 使用 PUT 方法添加了索引? (使用cli。curl --location --request PUT 'http://localhost:9200/some_index')

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-18
      • 2021-08-20
      • 1970-01-01
      • 2012-08-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多