SearchableInterface
interface SearchableInterface
Contract for models that can be indexed and searched.
This interface defines the public API that searchable models must implement. The Searchable trait provides a default implementation of these methods.
Methods
Get the requested models from an array of object IDs.
Get a query builder for retrieving the requested models from an array of object IDs.
Sync the soft deleted status for this model into the metadata.
Get the Scout engine for the model.
Get the queue connection that should be used when syncing.
Get the queue that should be used with syncing.
Make the given model instance searchable.
Remove the given model instance from the search index.
Get the index name for the model when searching.
Get the index name for the model when indexing.
Get the indexable data array for the model.
Determine if the model should be searchable.
Get the value used to index the model.
Get the key name used to index the model.
Get the auto-incrementing key type for querying models.
Get all Scout related metadata.
Set a Scout related metadata.
Details
at line 26
static Builder
search(string $query = '', Closure|null $callback = null)
Perform a search against the model's indexed data.
at line 31
Collection
getScoutModelsByIds(Builder $builder, array $ids)
Get the requested models from an array of object IDs.
at line 36
Builder
queryScoutModelsByIds(Builder $builder, array $ids)
Get a query builder for retrieving the requested models from an array of object IDs.
at line 41
Collection
makeSearchableUsing(Collection $models)
Modify the collection of models being made searchable.
at line 48
SearchableInterface
pushSoftDeleteMetadata()
Sync the soft deleted status for this model into the metadata.
at line 53
Engine
searchableUsing()
Get the Scout engine for the model.
at line 58
string|null
syncWithSearchUsing()
Get the queue connection that should be used when syncing.
at line 63
string|null
syncWithSearchUsingQueue()
Get the queue that should be used with syncing.
at line 68
void
searchable()
Make the given model instance searchable.
at line 73
void
unsearchable()
Remove the given model instance from the search index.
at line 78
string
searchableAs()
Get the index name for the model when searching.
at line 83
string
indexableAs()
Get the index name for the model when indexing.
at line 88
array
toSearchableArray()
Get the indexable data array for the model.
at line 93
bool
shouldBeSearchable()
Determine if the model should be searchable.
at line 98
mixed
getScoutKey()
Get the value used to index the model.
at line 103
string
getScoutKeyName()
Get the key name used to index the model.
at line 108
string
getScoutKeyType()
Get the auto-incrementing key type for querying models.
at line 113
array
scoutMetadata()
Get all Scout related metadata.
at line 120
SearchableInterface
withScoutMetadata(string $key, mixed $value)
Set a Scout related metadata.