{"record":{"id":"87b8562d92f4402f","repo":"n8n-io/n8n","slug":"index-indexfield-not-found","errorCode":null,"errorMessage":"Index ${indexField} not found","messagePattern":"Index (.+?) not found","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.ts","lineNumber":345,"sourceCode":"\t\tconst indexField = getIndexName(context, itemIndex).trim();\n\t\tconst keyPrefixField = getKeyPrefix(context, itemIndex).trim();\n\t\tconst metadataField = getMetadataKey(context, itemIndex).trim();\n\t\tconst contentField = getContentKey(context, itemIndex).trim();\n\t\tconst embeddingField = getEmbeddingKey(context, itemIndex).trim();\n\t\tconst filter = getMetadataFilter(context, itemIndex).trim();\n\n\t\tif (client === null) {\n\t\t\tthrow new NodeOperationError(context.getNode(), 'Redis client not initialized', {\n\t\t\t\titemIndex,\n\t\t\t\tdescription: 'Please check your Redis connection details',\n\t\t\t});\n\t\t}\n\n\t\t// Check if index exists by trying to get info about it\n\t\ttry {\n\t\t\tawait client.ft.info(indexField);\n\t\t} catch (error) {\n\t\t\tthrow new NodeOperationError(context.getNode(), `Index ${indexField} not found`, {\n\t\t\t\titemIndex,\n\t\t\t\tdescription: 'Please check that the index exists in your Redis instance',\n\t\t\t});\n\t\t}\n\n\t\t// Process filter: split by comma, trim, and remove empty strings\n\t\t// If no valid filter terms exist, pass undefined instead of empty array\n\t\tconst filterTerms = filter\n\t\t\t? filter\n\t\t\t\t\t.split(',')\n\t\t\t\t\t.map((s) => s.trim())\n\t\t\t\t\t.filter((s) => s)\n\t\t\t: [];\n\n\t\treturn new ExtendedRedisVectorSearch(\n\t\t\tembeddings,\n\t\t\t{\n\t\t\t\tredisClient: client,","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vector_store/VectorStoreRedis/VectorStoreRedis.node.ts#L327-L363","documentation":"Thrown by the Redis vector store node during retrieval, after it calls client.ft.info(indexField) to confirm the RediSearch index exists. If that command rejects, n8n assumes the index name resolved from the node parameters does not exist on the connected Redis instance. It is a pre-flight guard before the similarity search is attempted.","triggerScenarios":"Retrieval/load mode (or any path calling retrieve via the node) where indexField = getIndexName(context, itemIndex) names a key that FT.INFO cannot resolve on the Redis server the credentials point to. Any non-zero exit from ft.info (unknown index, module missing, connection dropped mid-call) lands here.","commonSituations":"Index name typo or wrong casing (RediSearch index names are case-sensitive); connecting to a different Redis DB/host than where the index was built; index was FLUSHALL'd or expired; RediSearch/RedisSearch module not loaded so ft.info is undefined; an earlier Insert run failed so the index was never created.","solutions":["In redis-cli against the SAME Redis instance/DB the node connects to, run FT.INFO <indexName>; if it errors, the index is absent and must be (re)created.","Confirm the node's index name parameter matches exactly the name used in the populate/Insert operation (case-sensitive).","Run MODULE LIST and confirm redisearch/redistimeseries is loaded; if not, enable the module on your Redis server.","Run the vector store Insert/Populate operation first so FT.CREATE runs before retrieval.","Verify the connection credentials and Redis logical database index match the environment where the index lives."],"exampleFix":"// before: index name resolved to \"MyIndex\"\n// after:  index name set to \"myindex\" (exact FT.CREATE name)\n// verify in redis-cli:\n//   FT.INFO myindex","handlingStrategy":"validation","validationCode":"// before retrieval, verify the index exists via FT.INFO\nimport type { RedisClientType } from 'redis';\nasync function assertIndexExists(client: RedisClientType, indexName: string) {\n  try {\n    await client.ft.info(indexName);\n  } catch {\n    throw new Error(`Refusing to query: RediSearch index '${indexName}' not found. Create it with FT.CREATE first.`);\n  }\n}\n// await assertIndexExists(client, indexField);","typeGuard":"function isValidIndexName(name: unknown): name is string {\n  return typeof name === 'string' && name.trim().length > 0 && !/[\\s]/.test(name);\n}","tryCatchPattern":"try { await nodeRetrieve(redisStore) } catch (e) { if (/Index .* not found/.test(e.message)) { /* recreate index then retry once */ } else throw e; }","preventionTips":["Run Insert/Populate before Retrieve so FT.CREATE always precedes FT.INFO.","Parameterize the index name in one place and reuse it for both Insert and Retrieve.","Add a startup health check that runs FT.INFO for expected indexes.","Pin the Redis instance/DB in credentials to avoid cross-environment mismatches."],"tags":["redis","vector-store","redisearch","config","index"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}