List_search_indexes() status of `DOES_NOT_EXIST`

When I call listSearchIndexes (through pymongo, mongosh, and Compass), it shows the status of my search index as DOES_NOT_EXIST, which is both confusing (why is it listed, then?) and undocumented.

I believe that it got into this state via an updateSearchIndex call.


  'id': '657b23efff7f2431cbfe8d1a',
  'name': 'my_vsi',
  'status': 'DOES_NOT_EXIST',
  'queryable': False, 'latestVersion': 1,
  'latestDefinition': {
    'name': 'my_vsi',
    'mappings': {
      'dynamic': True,
      'fields': {
        'model': {'type': 'token', 'normalizer': 'lowercase'},
        'dataset': {'type': 'token'},
        'vector': {'type': 'knnVector', 'dimensions': 1024, 'similarity': 'cosine'},
        'tokenizer': {'type': 'token', 'normalizer': 'lowercase'}

The index previously worked without the dataset filter field.

Any idea what went wrong / how I can avoid it in the future?

Mongo let me create the search index again using the same name/definition and it immediately went into the READY state. Deleting the search index removed both, of course.

Maybe my temporary solution is to delete / create instead of update.

delete / create does not actually save you from entering this state. My current approach is to delete, poll until the status changes to DOES_NOT_EXIST or the index disappears, and then create. I haven’t had it happen since I started using that approach.