Comments (2)
@mmachatschek there definitely seems to be an issue with laravel/scout and the documentation as well as the behavior of getScoutKeyName()
in the laravel/scout code as well. The base method returns the qualified name meaning <table>.<key>
. This causes issues.
I still feel that this should apply so that using the --key option in the scout:index command can be implemented without the need for implementing the change to the toSearchableArray()
method and allow use of the custom key name for tables without an id
field.
If getScoutKeyName()
was implemented correctly in laravel/scout only one change would need to be made in the getKeyName()
method and that change would cascade.
Regardless, before this can happen, laravel/scout needs to be amended.
from meilisearch-laravel-scout.
I think that this would not work out as expected.
The getScoutKeyName()
method is only used for fetching the models from the database not from the search index. It looks to me as if the documentation and the method description on laravel/scout is not correct.
This means that if we change getKeyName()
to getScoutKeyName()
in the MeiliSearchEngine class, everyone that uses the library also would need to add a toSearchableArray
method on each model and set the primaryKey name of that model to getScoutKeyName()
and the value to getScoutKey()
.
For Aloglia this works because there is a mandatory field ObjectID
that is sent with each create/update/delete. Whereas the identifier for a MeiliSearch index basically can be set to anything you want.
@keithza maybe you can point this out in the issues at laravel/scout
from meilisearch-laravel-scout.
Related Issues (20)
- search()->get() returns a maximum of 20 items HOT 1
- A primary key is already present. It's impossible to update it HOT 2
- using FacetFilters HOT 3
- cant find any good example tutorial ,correct me if iam doing wrong HOT 4
- The future of this repo HOT 17
- Delay for index new records HOT 1
- [DX] Easy index configuration HOT 2
- Creating index using php artisan not working HOT 7
- cant use toSearchableArray method HOT 3
- Include facetsDistribution in paginate() response? HOT 1
- Skip searching by ID HOT 5
- How to deploy and use laravel-scout and Meilisearch to ec2 instance HOT 5
- Update of existing records HOT 4
- Downgrading Meilisearch to version compatible with database HOT 1
- Getting an error when meilisearch service is not run HOT 1
- How to setup a custom timeout for a search ? HOT 8
- paginateRaw() returns wrong amount of total items HOT 4
- Laravel native support announced HOT 1
- One Model not importing HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meilisearch-laravel-scout.