LangChain:Fix error handling while creating index

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: AI/ML, LangChain
    • None
    • None
    • Python 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

      1. Update the error message which currently says only the M10+ clusters can create the indexes

      2. Attempt to create duplicate index throws incorrect error

       

       
      OperationFailure: Duplicate Index, full error: {'ok': 0.0, 'errmsg': 'Duplicate Index', 'code': 68, 'codeName': 'IndexAlreadyExists', '$clusterTime': {'clusterTime': Timestamp(1729656959, 20), 'signature': {'hash': b'\x0bf\xea\xb4\xff|gd?f\xdfT\x1bHI\xa2cU\xed\x85', 'keyId': 7384804414130749441}}, 'operationTime': Timestamp(1729656959, 20)} The above exception was the direct cause of the following exception: OperationFailure Traceback (most recent call last)
      /usr/local/lib/python3.10/dist-packages/langchain_mongodb/index.py in create_vector_search_index(collection, index_name, dimensions, path, similarity, filters, wait_until_complete, **kwargs) 87 ) 88 except OperationFailure as e: ---> 89 raise OperationFailure(_search_index_error_message()) from e 90 91 if wait_until_complete: OperationFailure: Search index operations are not currently available on shared clusters, such as MO. They require dedicated clusters >= M10. You may still perform vector search. You simply must set up indexes manually. Follow the instructions here: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/

            Assignee:
            Casey Clements
            Reporter:
            Prakul Agarwal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: