Vector Search return empty

I just created a new Atlas account and followed the Vector Search tutorial.
I am pretty sure that I followed every step exactly. Load sample data, create the vector index, and do the query…
But search results are always empty. I am not sure if the feature is ready to use or still in development?

OMG. It’s about the index name, I just messed up the underscore and dash. Now it works well for me!
It also surprised me that there is no error message or log when query on a non-existent index.

2 Likes

Thanks for sharing, @Donny_Tian. Glad it works. Good point about the missing error message. I’ll pass on the suggestion.

I have the same problem. I wrote my code and name of the index in code and db the same, but I always receive only empty array in this code

loader = PyPDFLoader(“https://arxiv.org/pdf/2303.08774.pdf”)
data = loader.load()
docs = text_splitter1.split_documents(data)
vector_search_index = “vector_index”

vector_search = MongoDBAtlasVectorSearch.from_documents(
documents=docs,
embedding=OpenAIEmbeddings(disallowed_special=()),
collection=atlas_collection,
index_name=vector_search_index,
)
print("result: ", results)

Thanks Bro!
Saved me too
They should throw a error like “search index_name not found” instead of a empty list.