Comments (11)
@vrusua Hey) Actually you're right. The package missing scout:index and scout:delete-index commands. I believe they have to be added here as well. The issue with scout-index it accept index name not a model and we need settings and mappings for new index and scout:index don't have those parameters. If you want to index only part of your data you can create a model that will represent that part by adding a global scope to it. Then just import that model. Updates of that model will go to the index as well.
from laravel-scout-elasticsearch.
@vrusua ... If you want to index only part of your data you can create a model that will represent that part by adding a global scope to it. Then just import that model. Updates of that model will go to the index as well.
Yeah, got it, thanks for the workaround and a quick reply.
from laravel-scout-elasticsearch.
How do you create the index?
from laravel-scout-elasticsearch.
They are created automatically when importing the data. If you do not use scout:import
and save a new model the index is then also automatically created but without the timestamp at the end of the index name
from laravel-scout-elasticsearch.
Timestamp doesn't matter. Alias of an index is an identifier for search. Could create a minimally test to reproduce the issue?
from laravel-scout-elasticsearch.
If you create a simple Laravel application and install this package. Then create a simple model (let's say users) with a seeder. When you run the seeder an index will be created (users_index
). However, if you don't run the seeder and instead run the artisan command scout:import
before running the seeder, you will get an index created which will be users_index_TIMESTAMP
. This causes issues when you have an empty application and do not run the scout import initially.
from laravel-scout-elasticsearch.
The index users_index_TIMESTAMP
has an alias users_index
so the index name can be anything user_index_uuid
for example. The index index_user
doesn't have an alias but it has a name that matches to right alias, so it's strange to get the error. I'll test the case later but now I can recommend using User::disableSearchSyncing() before seeding and User::enableSearchSyncing()
after. Then you can run scout:import
from laravel-scout-elasticsearch.
I got around this issue by calling the scout:import
on my migration before any data is imported. This way, the indices are created correctly and then when the seeder is called, or a model is created, the index already exists so is added correctly using the alias.
from laravel-scout-elasticsearch.
Hi Sergey,
sorry for pushing the legacy record, but I'm still getting the same issue on V6.0.2:
The missing index is creating correctly (with the alias and named timestamp) using the scout:import
only when resending all the data. However, when we're calling some Eloquent updates, or running searchable()
explicitly - the newly created index appears without the alias and named timestamp.
Is there any way to sort out this?
This option will be useful when we don't need to sync full the data to Elastic but just part only. Thanks.
Cheers,
Ruslan
from laravel-scout-elasticsearch.
@matchish or maybe some guide how to implement createIndex()
for the scout:index
option?
from laravel-scout-elasticsearch.
@vrusua Feel free to implement createIndex method if you think that custom model can't solve your issue #223
from laravel-scout-elasticsearch.
Related Issues (20)
- [Feature] v5 with forked handcraftedinthealps/elasticsearch-dsl HOT 8
- [Feature] Change app namespace call in commands HOT 2
- [BUG] Call to a member function toCodeString() on null HOT 5
- [BUG] Bulk update error when saving with boolean HOT 1
- [BUG] NoNodeAvailableException: No alive nodes. All the 1 nodes seem to be down HOT 3
- [BUG] The attribute [routing] either does not exist or was not retrieved for model [App\Models\Track]. HOT 5
- [BUG] Possibly unexpected behaviour, when using additional callback in `search` HOT 3
- [Feature] Utilize custom "options" of a builder HOT 2
- configure stopwords HOT 1
- "current.health":"RED","message":"Cluster health status changed from [YELLOW] to [RED] HOT 1
- [BUG] ProgressBar updates are posted to stderr HOT 1
- [BUG] Class Elasticsearch\Client not found HOT 3
- [Feature] Add possibility to use RangeQuery and other terms instances as value for $scoutQuery->where() HOT 2
- php artisan scout:import error? Cannot use Encore\Admin\Form as Form because the name is already in use on line 21 HOT 10
- [Feature] Use SearchableScope instead PageScope HOT 4
- PHP 8.3 support HOT 2
- is there any way to revert to the previous index state before reindexing ? HOT 3
- Elastic has prefix restrictions on reads HOT 1
- How to use the latest version of this package with Elasticsearch 7? HOT 3
- PHP-Parser not in direct dependencies, PHP-Parser > 5.0 is incompatible HOT 1
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 laravel-scout-elasticsearch.