Conversation
Preview of modified filesPreview of modified Markdown: |
mikadamczyk
reviewed
Feb 10, 2026
| Searching with embeddings can be combined with traditional search criteria and filters, which allows the semantic search to be constrained by content type, location, permissions, or other search criteria. | ||
|
|
||
| An embedding query is represented by the `Ibexa\Contracts\Core\Repository\Values\Content\EmbeddingQuery` value object. | ||
| The object encapsulates the vector to search for, along with configuration such as the embedding model and similarity threshold. |
Contributor
There was a problem hiding this comment.
EmbeddingQuery has no model or threshold fields. It only has embedding, filter, limit/offset, aggregations, performCount.
|
|
||
| ``` php | ||
| use Ibexa\Contracts\Core\Repository\Values\Content\EmbeddingQueryBuilder; | ||
| use Ibexa\Contracts\Core\Repository\Values\Content\Embedding; |
Contributor
There was a problem hiding this comment.
no such thing like Ibexa\Contracts\Core\Repository\Values\Content\Embedding, maybe you were thinking about use Ibexa\Contracts\Core\Repository\Values\Content\Query\Embedding;
But Embedding is abstract and expects float[], so this snippet won’t compile
Suggested change
| use Ibexa\Contracts\Core\Repository\Values\Content\Embedding; | |
| use Ibexa\Contracts\Taxonomy\Search\Query\Value\TaxonomyEmbedding |
| use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; | ||
|
|
||
| // Create an embedding object that represents the search input | ||
| $embedding = new Embedding('Find content similar to this text'); |
Contributor
There was a problem hiding this comment.
This class accepts
/**
* @param float[] $value
*/
public function __construct(array $value)
{
$this->value = $value;
}
| ``` php | ||
| use Ibexa\Contracts\Core\Repository\Values\Content\EmbeddingQueryBuilder; | ||
| use Ibexa\Contracts\Core\Repository\Values\Content\Embedding; | ||
| use Ibexa\Contracts\Core\Repository\Values\Content\Query\Aggregation; |
Contributor
There was a problem hiding this comment.
Aggregation is an interface, cannot be instantiated
| ->setLimit(10) // maximum number of results | ||
| ->setOffset(0) // result offset for pagination | ||
| ->setPerformCount(true) // optionally count total matching items | ||
| ->setAggregations([ |
Contributor
There was a problem hiding this comment.
we could remove aggregations from the snippet (focus on embeddings) or:
->setAggregations([
new ContentTypeTermAggregation('count_by_type'),
])
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe Embeddings search API
Checklist