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

Restrict Indexing to a Subset of Your Data? #42

Closed
dennisoderwald opened this issue Sep 1, 2016 · 2 comments
Closed

Restrict Indexing to a Subset of Your Data? #42

dennisoderwald opened this issue Sep 1, 2016 · 2 comments

Comments

@dennisoderwald
Copy link

dennisoderwald commented Sep 1, 2016

I think Scout needs a function to select which entries are indexed. The implementation of Algolia's Laravel Plugin has an indexOnly() function.

https://github.com/algolia/algoliasearch-laravel#restrict-indexing-to-a-subset-of-your-data

@pvanhemmen
Copy link

You can set the hidden property on the model for all fields that should not be indexed. At least this works for me in combination with the elasticsearch driver. All hidden fields will not be converted to JSON or arrays and thus not be pushed to the index. The visibleproperty should work as well, but I haven't tested it yet.

https://laravel.com/docs/5.3/eloquent-serialization#hiding-attributes-from-json

@driesvints
Copy link
Member

You can use the toSearchableArray method.

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

No branches or pull requests

3 participants