Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto-embedding fields #56

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

SergioMendolia
Copy link

@SergioMendolia SergioMendolia commented Feb 7, 2025

Allows to configure auto embedding fields

@SergioMendolia

This comment was marked as resolved.

@SergioMendolia SergioMendolia marked this pull request as draft February 7, 2025 07:40
@SergioMendolia SergioMendolia self-assigned this Feb 7, 2025
Copy link
Contributor

github-actions bot commented Feb 7, 2025

Coverage report for commit: 379e705
File: tests/coverage/clover.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ██░░░░░░░░░░░░░░░░░░░░░ │  5.9%
  10% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  60% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  70% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  80% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  90% │ █████░░░░░░░░░░░░░░░░░░ │ 14.7%
 100% │ ███████████████████████ │ 79.4%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution / ▒ = Previous Distribution
Summary - Lines: 84.58% 🔼 | Methods: 77.71% 🔽
FilesLinesMethodsBranches
src
   AbstractBiblioverseTypesenseBundle.php100.00%100.00%100.00%
   BiblioverseTypesenseBundle.php100.00%100.00%100.00%
src/Client
   ClientAdapter.php92.31%92.31%100.00%
   ClientInterface.php100.00%100.00%100.00%
   ClientSingletonFactory.php91.30%60.00%100.00%
src/CollectionAlias
   AliasException.php100.00%100.00%100.00%
   CollectionAlias.php100.00%100.00%100.00%
   CollectionAliasInterface.php100.00%100.00%100.00%
src/Command
   TypesensePopulateCommand.php98.04%75.00%100.00%
src/EventSubscriber
   IndexCollectionSubscriber.php100.00%100.00%100.00%
src/Exception
   SearchException.php100.00%100.00%100.00%
src/Indexer
   Indexer.php100.00%100.00%100.00%
   IndexerInterface.php100.00%100.00%100.00%
src/Mapper
   CollectionManagerInterface.php100.00%100.00%100.00%
   DataGeneratorInterface.php100.00%100.00%100.00%
   MappingGeneratorInterface.php100.00%100.00%100.00%
   StandaloneCollectionManagerInterface.php100.00%100.00%100.00%
src/Mapper/Converter/Exception
   ValueConversionException.php100.00%100.00%100.00%
   ValueExtractorException.php100.00%100.00%100.00%
src/Mapper/Converter
   ToTypesenseInterface.php100.00%100.00%100.00%
   ValueConverter.php91.53%25.00%100.00%
   ValueConverterInterface.php100.00%100.00%100.00%
   ValueExtractor.php94.44%66.67%100.00%
   ValueExtractorInterface.php100.00%100.00%100.00%
src/Mapper/Entity
   AbstractEntityDataGenerator.php100.00%100.00%100.00%
   EntityCollectionManagerInterface.php100.00%100.00%100.00%
   EntityDataGenerator.php100.00%100.00%100.00%
   EntityMapperGenerator.php100.00%100.00%100.00%
   EntityTransformer.php90.00%66.67%100.00%
   EntityTransformerInterface.php100.00%100.00%100.00%
src/Mapper/Entity/Identifier
   EntityIdentifier.php88.89%50.00%100.00%
   EntityIdentifierInterface.php100.00%100.00%100.00%
src/Mapper/Fields
   FieldMapping.php93.33%62.50%100.00%
   FieldMappingInterface.php100.00%100.00%100.00%
src/Mapper/Locator
   InvalidTypeMapperException.php100.00%100.00%100.00%
   MapperLocator.php86.00%50.00%100.00%
   MapperLocatorInterface.php100.00%100.00%100.00%
src/Mapper/Mapping
   Mapping.php100.00%100.00%100.00%
   MappingInterface.php100.00%100.00%100.00%
src/Mapper/Metadata
   MetadataMapping.php100.00%100.00%100.00%
   MetadataMappingInterface.php100.00%100.00%100.00%
src/Mapper/Options
   CollectionOptions.php100.00%100.00%100.00%
   CollectionOptionsInterface.php100.00%100.00%100.00%
src/Populate
   BatchGenerator.php100.00%100.00%100.00%
   PopulateService.php89.66%71.43%100.00%
src/Populate/WaitFor
   AbstractWaitForService.php100.00%100.00%100.00%
   WaitForDatabaseService.php100.00%100.00%100.00%
   WaitForInterface.php100.00%100.00%100.00%
   WaitForTypesenseService.php100.00%100.00%100.00%
src/Query
   SearchQuery.php--100.00%
   SearchQueryInterface.php100.00%100.00%100.00%
   VectorQuery.php--100.00%
   VectorQueryInterface.php100.00%100.00%100.00%
   VoiceQueryInterface.php100.00%100.00%100.00%
src/Search/Hydrate
   HydrateRepositoryInterface.php100.00%100.00%100.00%
   HydrateSearchResult.php88.89%50.00%100.00%
   HydrateSearchResultInterface.php100.00%100.00%100.00%
src/Search/Results
   AbstractSearchResults.php100.00%100.00%100.00%
   SearchResults.php100.00%100.00%100.00%
   SearchResultsHydrated.php100.00%100.00%100.00%
src/Search
   Search.php--100.00%
   SearchCollection.php--100.00%
   SearchCollectionInterface.php100.00%100.00%100.00%
   SearchInterface.php100.00%100.00%100.00%
src/Type
   DataTypeEnum.php100.00%100.00%100.00%
   FacetStrategyEnum.php100.00%100.00%100.00%
   InfixEnum.php100.00%100.00%100.00%
src/Utils
   ArrayAccessTrait.php100.00%100.00%100.00%

🤖 comment via lucassabreu/comment-coverage-clover

@SergioMendolia SergioMendolia marked this pull request as ready for review February 7, 2025 12:14

Unless you want to store embeddings in your database, you can specify `mapped: false` in the configuration, the embeddings will only live in typesense.

In this case, we recommend to exclude the fields from being retrieved when doing a query as.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"In this case, we recommend excluding these fields from being retrieved in the query."

* 'embed'?:null|FieldMappingEmbedArray,
* 'mapped'?:bool
* }
* @phpstan-type FieldMappingEmbedArray array{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am hesitating to create an object for this type instead of using an array.

@@ -197,7 +197,8 @@ public function toArray(): array
'synonym_prefix' => $this->synonymPrefix,
'text_match_type' => $this->textMatchType,
'typo_tokens_threshold' => $this->typoTokensThreshold,
'vector_query' => $this->vectorQuery?->toArray(),
// @phpstan-ignore-next-line (->toArray is part of vectorInterface)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't ignore anything, nothing has been ignored so far

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants