【问题标题】:Laravel Scout with TNTSearch driver filtering where clauseLaravel Scout 与 TNTSearch 驱动过滤 where 子句
【发布时间】:2019-05-01 12:44:48
【问题描述】:

我尝试在使用 TNTSearch 的查询中使用 where 子句获取搜索查询的结果,但它不起作用。查询没有得到where 子句。

控制器

<?php

public function getLigues(Request $request)
{
    if ($request->has('recherche')) {
        $ligues = Structure::search($request->recherche)->where('type_structure_id', '2')->get();
    } else {
        $ligues = Structure::where('type_structure_id', 2)->paginate(1);
    }

    return view('structure/ligues', compact('ligues'));
}

有人对如何获取过滤器查询有任何想法吗?

【问题讨论】:

    标签: laravel laravel-scout


    【解决方案1】:

    请在官方TNT Search Repository 上通过this issue #59

    在同一问题上查看contributors comment

    Where() 子句还不支持!

    还有其他解决方法可以实现此测试用例,用于检查存储库上的 issues

    【讨论】:

      猜你喜欢
      • 2018-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-28
      • 1970-01-01
      相关资源
      最近更新 更多