Doctrine ODM: Support Vector Search index and stage - documentation

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Doctrine
    • None
    • PHP Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Add $vectorSearch stage to Doctrine MongoDB ODM.

      Prototype: https://github.com/GromNaN/symfony-celebrity-lookalike/blob/027426b3a584c278024324b74fde022ec8962a07/src/Doctrine/ODM/MongoDB/Aggregation/VectorSearchStage.php 

      There is a strong relation between the $vectorSearch stage and the Vector Search index. It should be possible to automatically fill the "path" value from the index name, using the document VectorSearch metadata

      ->vectorSearch()
          ->index('faces')
          ->path('descriptionEmbeddings') // could be omitted
          ->numCandidates($limit * 20)
          ->queryVector($face->descriptionEmbeddings)
          ->limit($limit)

      Question: is there a risk of confusion between limit parameter and the $limit stage in the fluent API ?

      We can also create a #[VectorIndex] attribute that extend #[SearchIndex], promoting all the properties as main parameters.

      #[ODM\VectorIndex(
          name: 'descriptions',
          numDimensions: 1024,
          path: 'descriptionEmbeddings',
          similarity: 'euclidean',
          filters: ['packages', 'tags'],
      )]

            Assignee:
            Unassigned
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 3 weeks
                3w
                Remaining:
                Remaining Estimate - 3 weeks
                3w
                Logged:
                Time Spent - Not Specified
                Not Specified