Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search cross multiple index #233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Romer4ig
Copy link

@Romer4ig Romer4ig commented Feb 28, 2024

I see in old PR and found code. rewrite it to current state for use within() Scout function as example

MixedSearch::search()->within(implode(',', [
    (new Movie())->searchableAs(),
    (new Series())->searchableAs(),
    (new Trailer())->searchableAs(),
]))->get();

@Jeroen-G
Copy link
Owner

What does it do and how should I test it? 🤔

@Romer4ig
Copy link
Author

Romer4ig commented Mar 6, 2024

What does it do and how should I test it? 🤔
This functionality is inspired by the official Elasticsearch documentation available at https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multiple-indices.html.
Additionally, I found a similar example in another library at https://github.com/matchish/laravel-scout-elasticsearch?tab=readme-ov-file#search-amongst-multiple-models.
As I mentioned earlier, there was a request to implement such functionality in another pull request.
The expected test scenario involves creating two indices from two different models. The search operation should return corresponding entities from these two different tables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants