Questions tagged [laravel-scout]

A Laravel package that provides a simple, driver based solution for adding full-text search to models.

Laravel Scout provides a simple, driver based solution for adding full-text search to Laravel's Eloquent models. Using model observers, Scout will automatically keep your search indexes in sync with your Eloquent records.

Documentation is available at https://laravel.com/docs/5.4/scout

This is not a package which is included in the default installation of Laravel so it needs to be installed independently.

225 questions
42
votes
15 answers

count(): Parameter must be an array or an object that implements Countable

I'm facing strange case. I face an error in production env not while in dev it's working fine. Development: Laravel 5.4.28 PHP 7.0.13 MYSQL 5.7.17 Production: Laravel 5.4.28 PHP 7.2.1 MYSQL 5.7.20 In implementation code. I used: namespace App; use…
Khaled Al-Shehri
  • 421
  • 1
  • 4
  • 5
13
votes
5 answers

Laravel Scout: only search in specific fields

Laravel Scout: Is there a way that I search in only a specific field? At the moment this line is working fine: $es = Element::search($q)->get(); But it searches title, shortdescription and description fields. I need it to only search in title…
user7432810
  • 655
  • 3
  • 11
  • 24
11
votes
2 answers

Check if Elasticsearch has finished indexing

Is there a way to check if Elasticsearch has finished processing my request? I want to perform integration tests for my application checking if a record can be found after insertion. For example if I make a following request: POST /_all/_bulk { …
10
votes
2 answers

Elasticsearch and Laravel scout-elasticsearch-driver return an empty response

First i use scout-elasticsearch-driver for Laravel Scout: https://github.com/babenkoivan/scout-elasticsearch-driver I followed step by step the readme, create the index, migrate the index, configure a mapping and User::search()->get() returns an…
loic.lopez
  • 2,013
  • 2
  • 21
  • 42
9
votes
2 answers

Laravel Scout Search with FacetFilters?

As you know, using where() statement after the search method uses numericFilter. I am trying to filter my search results with string filtering. How can I use Facet Filter on search statement?
bl4cksta
  • 794
  • 12
  • 32
8
votes
1 answer

Multi-language indexes with Laravel Scout and Algolia

How should I manage the multi-language indexes (For example: page / page_translations models should become page_en / page_fr indexes). I am using "Dimsav\Translatable" package. Page model: id, status_id, created_at, updated_at PageTranslation model:…
Dorin Niscu
  • 721
  • 1
  • 9
  • 26
7
votes
1 answer

Laravel Scout toSearchableArray attribute is not filterable

I've been doing some testing with laravel scout and according to the documentation (https://laravel.com/docs/8.x/scout#configuring-searchable-data), I've mapped my User model as such: /** * Get the indexable data array for the model. * …
abr
  • 2,071
  • 22
  • 38
7
votes
2 answers

Laravel scout search in relationships

I can't seem to figure out how to search in 2 tables within 1 query in Laravel scout. For specific reasons that are not important right now, I don't want to just run raw queries. Right now I have this to search: My relationship: namespace App; use…
Loko
  • 6,539
  • 14
  • 50
  • 78
6
votes
2 answers

elastic search failed to parse date field with format [strict_date_optional_time||epoch_millis]

To begin with, the date format that that is stored in the index is 2021-09-16T14:06:02.000000Z When I log in with the option to remember the user and then I log out, I get the following error. The response from ElasticSearch is array:3 [▼ "took"…
Orestis uRic
  • 347
  • 1
  • 6
  • 11
5
votes
1 answer

Relational search using laravel-scout-tntsearch-driver package for Laravel Scout

I'm using the laravel-scout-tntsearch-driver package for Laravel Scout. I have implemented it, and everything works fine. But now I want to do a relational search. I have cities that have many companies. City.php public function companies() { …
pwnz22
  • 469
  • 2
  • 9
  • 19
5
votes
3 answers

Laravel Scout with Elastic search not working

I tried Using Elastic search with Laravel scout with packages "laravel/scout": "^1.0", "tamayo/laravel-scout-elastic": "^1.0" Ran Elasticsearch server in localhost:9200 and created index and gave necessary config's, added searchable trait's to…
4
votes
1 answer

laravel scout search with multiple model

I used this old code, and start refactor it with use of laravel/scout. This code is a simply search function thet search in posts and pages too, and show result mixed paginate. Old code: public function search($term) { $post =…
Bálint Bakos
  • 474
  • 2
  • 5
  • 21
4
votes
1 answer

Laravel Scout v.s. MySQL Full Text Index?

I'm pretty new to Laravel and I've already got a light Laravel app running in production. Now I have to implement a full-text search (e.g. search content in all posts), I came across these options: Laravel Scout MySQL Full-Text Index 1+2 => Laravel…
4
votes
1 answer

Test with models indexed by Laravel Scout fails

I'm writing a test for finding models with Scout. I'm on Laravel 5.4 and use the provider "tamayo/laravel-scout-elastic": "^3.0". It seems that in my tests indexing the created items isn't completed when I start searching for a model. Is this true?…
Stan
  • 493
  • 4
  • 15
3
votes
3 answers

Laravel Scout (Meilisearch) - Says imported data, but doesn't

I've installed and configured meilisearch + Laravel Scout package. My Model: class Post extends Model { use Searchable; } When I run php artisan scout:import 'App\Models\Post' it returns: Imported [App\Models\Post] models up to ID: 5 All…
X 47 48 - IR
  • 1,250
  • 1
  • 15
  • 28
1
2 3
14 15