Conversation
Preview of modified filesPreview of modified Markdown: |
mikadamczyk
reviewed
Feb 10, 2026
|
mikadamczyk
reviewed
Feb 27, 2026
|
|
||
| - [EmbeddingQueryBuilder](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-EmbeddingQueryBuilder.html): | ||
| A fluent builder for constructing `EmbeddingQuery` instances. | ||
| It enforces required parameters and integrates embedding queries with the search query pipeline |
Contributor
There was a problem hiding this comment.
Suggested change
| It enforces required parameters and integrates embedding queries with the search query pipeline | |
| It helps construct queries consistently and integrates embedding queries with the search query pipeline, but you must still provide the required embedding value. |
Comment on lines
+393
to
+394
| Validates embedding queries before they are passed to the search engine. | ||
| Implementations ensure that the embedding model exists and that vector dimensions match the configured embedding field |
Contributor
There was a problem hiding this comment.
Suggested change
| Validates embedding queries before they are passed to the search engine. | |
| Implementations ensure that the embedding model exists and that vector dimensions match the configured embedding field | |
| Validates embedding query structure before execution. | |
| Provider/model configuration and vector compatibility are resolved at runtime by the configured embedding and search engine components. |
Comment on lines
+19
to
+20
| - [`Ibexa\Contracts\Core\Repository\Values\Content\Query\Embedding`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Query-Embedding.html): Represents the semantic input used for similarity search. | ||
| Depending on the embedding provider, it can encapsulate text or vector data |
Contributor
There was a problem hiding this comment.
Suggested change
| - [`Ibexa\Contracts\Core\Repository\Values\Content\Query\Embedding`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Query-Embedding.html): Represents the semantic input used for similarity search. | |
| Depending on the embedding provider, it can encapsulate text or vector data | |
| - [`Ibexa\Contracts\Core\Repository\Values\Content\Query\Embedding`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-Query-Embedding.html): Represents the vector input used for similarity search. | |
| It stores embedding values as float arrays, while providers generate those vectors from text input. |
|
|
||
| ## Embedding providers | ||
|
|
||
| Embedding providers generate vector representations for inputs. |
Contributor
There was a problem hiding this comment.
Suggested change
| Embedding providers generate vector representations for inputs. | |
| Embedding providers generate vector representations for inputs. Out of the box, embedding search integration is provided for TaxonomyEmbedding. If you use a custom embedding value type, implement matching embedding visitors for your search engine (Solr/Elasticsearch). Otherwise, query execution may fail with "No visitor available". |
Comment on lines
+403
to
+423
| use Ibexa\Contracts\Core\Repository\Values\Content\EmbeddingQueryBuilder; | ||
| use Ibexa\Contracts\Core\Repository\Values\Content\Query\Embedding; | ||
|
|
||
| // Example embedding vector (float[]) | ||
| $vector = [ | ||
| 0.0123, | ||
| -0.9876, | ||
| 0.4567, | ||
| // ... | ||
| ]; | ||
|
|
||
| // Create an Embedding instance with a float[] vector | ||
| $embedding = new Embedding($vector); | ||
|
|
||
| // Build the embedding query with the fluent builder | ||
| $embeddingQuery = EmbeddingQueryBuilder::create() | ||
| ->withEmbedding($embedding) | ||
| ->setLimit(10) // maximum number of results | ||
| ->setOffset(0) // result offset for pagination | ||
| ->setPerformCount(true) // optionally count total matching items | ||
| ->build(); |
Contributor
There was a problem hiding this comment.
Suggested change
| use Ibexa\Contracts\Core\Repository\Values\Content\EmbeddingQueryBuilder; | |
| use Ibexa\Contracts\Core\Repository\Values\Content\Query\Embedding; | |
| // Example embedding vector (float[]) | |
| $vector = [ | |
| 0.0123, | |
| -0.9876, | |
| 0.4567, | |
| // ... | |
| ]; | |
| // Create an Embedding instance with a float[] vector | |
| $embedding = new Embedding($vector); | |
| // Build the embedding query with the fluent builder | |
| $embeddingQuery = EmbeddingQueryBuilder::create() | |
| ->withEmbedding($embedding) | |
| ->setLimit(10) // maximum number of results | |
| ->setOffset(0) // result offset for pagination | |
| ->setPerformCount(true) // optionally count total matching items | |
| ->build(); | |
| use Ibexa\Contracts\Core\Repository\Values\Content\EmbeddingQueryBuilder; | |
| use Ibexa\Contracts\Core\Repository\Values\Content\Query\Criterion\ContentTypeIdentifier; | |
| use Ibexa\Contracts\Taxonomy\Search\Query\Value\TaxonomyEmbedding; | |
| $vector = [ | |
| 0.0123, | |
| -0.9876, | |
| 0.4567, | |
| ... | |
| ]; | |
| $embedding = new TaxonomyEmbedding($vector); | |
| $embeddingQuery = EmbeddingQueryBuilder::create() | |
| ->withEmbedding($embedding) | |
| ->setFilter(new ContentTypeIdentifier('article')) | |
| ->setLimit(10) | |
| ->setOffset(0) | |
| ->setPerformCount(true) | |
| ->build(); |
| ->build(); | ||
|
|
||
| // Execute the query via the repository | ||
| $results = $repository->findContent($embeddingQuery); |
Contributor
There was a problem hiding this comment.
Suggested change
| $results = $repository->findContent($embeddingQuery); | |
| use Ibexa\Contracts\Core\Repository\Repository; | |
| use Ibexa\Contracts\Core\Repository\SearchService; | |
| use Ibexa\Contracts\Core\Repository\Values\Content\EmbeddingQueryBuilder; | |
| use Ibexa\Contracts\Taxonomy\Search\Query\Value\TaxonomyEmbedding; | |
| final class ExampleService | |
| { | |
| private SearchService $searchService; | |
| public function __construct(Repository $repository) | |
| { | |
| $this->searchService = $repository->getSearchService(); | |
| } | |
| public function searchByEmbedding(array $vector): void | |
| { | |
| $query = EmbeddingQueryBuilder::create() | |
| ->withEmbedding(new TaxonomyEmbedding($vector)) | |
| ->setLimit(10) | |
| ->setOffset(0) | |
| ->build(); | |
| $result = $this->searchService->findContent($query); | |
| foreach ($result->searchHits as $hit) { | |
| // ... | |
| } | |
| } | |
| } | |
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