Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-4864

Unable to create Vector search index via MongoDB driver

    • Type: Icon: Task Task
    • Resolution: Gone away
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 2.22.0
    • Component/s: Builders
    • None
    • 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?

      Hi,

      I would like to perform a vector cosine similarity in mongo DB. For that as a first step I need to create an index similar to below

      {{{}}
        "createIndexes": "<collection_name>",
        "indexes": [
          {
            "name": "<index_name>",
            "key": {
              "<path_to_property>": "cosmosSearch"
            },
            "cosmosSearchOptions": {
              "kind": "vector-ivf",
              "numLists": <integer_value>,
              "nProbes": <integer_value>,
              "similarity": "<string_value>",
              "dimensions": <integer_value>
      {{      }}}

      I want to do the same via MongoDB C# drivers. This is because I create the collection dynamically via code. I tried using the CreateIndexModelOptions. This class does not seem to have the properties required to create the above index. How do I go about doing this ?

       

      {{    }}}
        ]
      }

       

            Assignee:
            boris.dogadov@mongodb.com Boris Dogadov
            Reporter:
            venkateshsrini3@gmail.com VenkateshSrini N/A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: