PerformsDatabaseVectorSearch
trait PerformsDatabaseVectorSearch
Methods
Update the searchable embeddings for the given models.
Get hybrid search results using weighted reciprocal rank fusion.
Fuse text and semantic results using weighted reciprocal rank fusion.
Apply Scout's non-search constraints to a query.
Generate embeddings using the optional Hypervel AI SDK.
Ensure semantic search is supported by the model's database.
Details
at line 23
protected void
updateSearchableEmbeddings(Collection $models)
Update the searchable embeddings for the given models.
at line 84
protected Collection
hybridSearchModels(Builder $builder, int $limit)
Get hybrid search results using weighted reciprocal rank fusion.
at line 144
protected Collection
fuseSearchResults(Builder $builder, Collection $textModels, Collection $semanticModels)
Fuse text and semantic results using weighted reciprocal rank fusion.
at line 179
protected Builder
buildSemanticSearchQuery(Builder $builder)
Build a semantic search query.
at line 205
protected float
minimumSimilarity(Builder $builder)
Get the minimum similarity for a semantic search.
at line 219
protected Builder
constrainSearchQuery(Builder $builder, Builder $query)
Apply Scout's non-search constraints to a query.
at line 230
protected array
generateEmbeddings(array $inputs)
Generate embeddings using the optional Hypervel AI SDK.
at line 250
protected string
embeddingColumn(Model $model)
Get the model's embedding column.
at line 266
protected bool
shouldPerformHybridSearch(Builder $builder)
Determine if a hybrid search should use vector search.
at line 276
protected bool
supportsVectorSearch(Model $model)
Determine if the model's database supports vector queries.
at line 284
protected void
ensureSemanticSearchIsSupported(Builder $builder)
Ensure semantic search is supported by the model's database.