Conversation
Preview of modified filesPreview of modified Markdown: |
Co-authored-by: Mikolaj Adamczyk <mikadamczyk@gmail.com>
code_samples/ change report
|
|
| @@ -0,0 +1,77 @@ | |||
| <?php | |||
|
|
|||
| /** | |||
There was a problem hiding this comment.
Please remove the copyright, this code sample is meant to be used by other freely
|
|
||
| Embedding queries have been introduced primarily to support the [Taxonomy suggestions](taxonomy.md#taxonomy-suggestions) feature, therefore embedding search integration is provided for `TaxonomyEmbedding`. | ||
| To use them in other scenarios that use a custom embedding value type, implement matching embedding | ||
| visitors for your search engine. |
| $io = new SymfonyStyle($input, $output); | ||
|
|
||
| // Example embedding vector. | ||
| // In a real-life scenario, generate it with an embedding provider |
There was a problem hiding this comment.
We should show people how to do this.
Can we just inject embeddingProviderResolver here, and do:
$embeddingProvider = $this->embeddingProviderResolver->resolve();
$embeddings = $embeddingProvider->getEmbedding('example_content');
(and private EmbeddingProviderResolverInterface $embeddingProviderResolver) in the constructor
| */ | ||
| public function searchByEmbedding(array $vector): SearchResult | ||
| { | ||
| $query = EmbeddingQueryBuilder::create() |
There was a problem hiding this comment.
The only difference is the lack of content type filter?
I'd combine these two into one sample, to make the maintenence easier for us in the future
|
|
||
| - [`Ibexa\Contracts\Core\Repository\Values\Content\EmbeddingQuery`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-EmbeddingQuery.html): Represents a semantic similarity search request. | ||
| It encapsulates an [Embedding](#embedding) instance and supports filtering, pagination, aggregations, and result counting through the same API as standard content queries. | ||
| Embedding queries do not support criteria, Sort Clauses, facet builders, or spellcheck |
There was a problem hiding this comment.
I'd mention the search engines where they are available.
Solr 9, ES, but not Legacy Search?
There was a problem hiding this comment.
Faceted searched is removed in v5, and deprecated in v4.6
Let's replace it with aggregations.
| echo $customField->getType(); // "custom_embedding_type" | ||
| ``` | ||
|
|
||
| For more information, see [Embeddings reference](embeddings_reference.md). |
There was a problem hiding this comment.
I'd link to https://doc.ibexa.co/en/5.0/search/extensibility/index_custom_elasticsearch_data/ here (I don't see an example for Solr right now).
Once you have the field, you have to listen to the indexing event (ContentIndexCreateEvent) and actually attach it to the index
| Models used to resolve embedding queries must be configured in [system configuration](configuration.md). | ||
| Each key defines the model's name, vector dimensionality, the field suffix used in the search index, and the embedding provider that generates vectors. | ||
|
|
||
| ``` yaml |
There was a problem hiding this comment.
I'd mention here:
- The
default_embedding_modelproperty - That the
field_suffixmust be unique for each model
There was a problem hiding this comment.
It could be:
Models used to resolve embedding queries must be configured in system configuration. Each entry defines the model name, vector dimensionality, the field suffix used in the search index, and the embedding provider that generates vectors. The default model is selected through default_embedding_model. Each model must use a unique field_suffix, as it becomes part of the indexed field name.`
|
|
||
| - [`Ibexa\Contracts\Core\Search\Embedding\EmbeddingProviderInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Search-Embedding-EmbeddingProviderInterface.html): Generates embeddings | ||
|
|
||
| - [`Ibexa\Contracts\Core\Search\Embedding\EmbeddingProviderRegistryInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Search-Embedding-EmbeddingProviderRegistryInterface.html): Lists available embedding providers |
There was a problem hiding this comment.
| - [`Ibexa\Contracts\Core\Search\Embedding\EmbeddingProviderRegistryInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Search-Embedding-EmbeddingProviderRegistryInterface.html): Lists available embedding providers | |
| - [`Ibexa\Contracts\Core\Search\Embedding\EmbeddingProviderRegistryInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Search-Embedding-EmbeddingProviderRegistryInterface.html): Lists available embedding providers or get one by its identifier |
| @@ -0,0 +1,50 @@ | |||
| --- | |||
There was a problem hiding this comment.
Please link to the search_api page for an example, or just include the example here as well.
In general, there's a lot of duplicated content between these two pages (this one and search_api.md), and it's hard to say which one is the primary one - search api links here for more information, but it's search_api.md that contains more information 🤔
This one does not include:
- Description of EmbeddingQueryBuilder
- Examples
Do we need this page?
| - [EmbeddingQuery](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-EmbeddingQuery.html): | ||
| Represents a semantic similarity search request. |
There was a problem hiding this comment.
Do we need the : ? This is not a pattern that was used in the doc previously, ever.
| - [EmbeddingQuery](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-EmbeddingQuery.html): | |
| Represents a semantic similarity search request. | |
| - [EmbeddingQuery](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Core-Repository-Values-Content-EmbeddingQuery.html) represents a semantic similarity search request. |




Describe Embeddings search API
Checklist