Skip to content

Commit

Permalink
weaviate[minor]: Add Document id in similarity search results (#6576)
Browse files Browse the repository at this point in the history
Co-authored-by: Brace Sproul <[email protected]>
  • Loading branch information
marsal and bracesproul authored Aug 22, 2024
1 parent b088c33 commit 28cbfd7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/langchain-weaviate/src/vectorstores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ export class WeaviateStore extends VectorStore {
.get()
.withClassName(this.indexName)
.withFields(
`${this.queryAttrs.join(" ")} _additional { distance vector }`
`${this.queryAttrs.join(" ")} _additional { distance vector id }`
)
.withNearVector({
vector: query,
Expand All @@ -321,6 +321,7 @@ export class WeaviateStore extends VectorStore {
new Document({
pageContent: text,
metadata: rest,
id: _additional.id,
}),
_additional.distance,
_additional.vector,
Expand Down

0 comments on commit 28cbfd7

Please sign in to comment.