V
V
vladimirr892018-03-22 22:16:22
Laravel
vladimirr89, 2018-03-22 22:16:22

Why search through algolia does not work in laravel?

Please explain how this can be, the site works correctly, it does not give any errors to the console, but at the same time it writes that it cannot find what it is obliged to find by definition? Since everything is logically spelled out and there are no jambs, or I don’t see them. It works through the algolia server, all accesses are registered correctly, when new material is loaded, they automatically get there, searchtables are also correct (search by name and description), but something goes wrong. Please help me how to fix the search?
Controller:

<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\{Channel, Video};

class SearchController extends Controller
{
    public function index(Request $request)
    {
        if (!$request->q) {
            return redirect('/');
        }

        $channels = Channel::search($request->q)->take(2)->get();
        $videos = Video::search($request->q)->where('visible', true)->get();

        return view('search.index', compact('channels', 'videos'));
    }
}

But it gives the result "No videos found." And I don’t know where to climb to control the process.
5ab400b3d1c37487785752.jpeg5ab400d04b627034904311.jpeg5ab400d6f2583070544879.jpeg

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question