php - laravel-search初试遇见的问题,求助!

 用户d4k2wd8en1 发布于 2022-11-16 13:18

按http://laravelacademy.org/post/3781.html 安装了Elasticsearch(启动后通过curl -X GET http://localhost:9200 测试正常返回信息) 及mmanos/laravel-search依赖 也相应按说明做了配置,最后写了调用程序,程序如下

search = $search;
    }
    public function insert(){
        $this->search->insert(
            "post-1",
            array(
                'title' => 'My title',
                'content' => 'The quick brown fox...',
                'status' => 'published',
            ),
            array(
                'created_at' => time(),
                'creator_id' => 5,
            )
        );

    }
    public function res(){
        $results = Search::search('content', 'fox')->get();
        var_dump($results);
    }
}

访问结果如下错误,

小弟水平低,请指点,谢谢!!!

1 个回答
  • 你看看下面的评论,目前第一条就是了。
    学院君回复是:

    有安装elasticsearch依赖组件吗

    2022-11-16 13:30 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有