teamtnt / laravel-scout-tntsearch-driver

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch
MIT License
1.1k stars 144 forks source link

Config whether primary key should be searchable #219

Closed gdesoto-lhs closed 3 months ago

gdesoto-lhs commented 5 years ago

Is there a way to allow the primary key to be searched? Past versions had this as default to always be searchable. Now according to the docs for teamtnt/tntsearch, the default is to not make it searchable but allows for the ability to make it searchable, if needed, using the $indexer->includePrimaryKey() method.

My workaround was to add the ID to a second key in the models toSearchableArray() method, however, it'd be nice to have a way to control this.

An example of the need for this would be looking up a student by their known ID number.