Unable to create Vector search index via MongoDB driver

XMLWordPrintableJSON

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

      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
            Reporter:
            VenkateshSrini N/A
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: