Skip to content

Commit

Permalink
Use the similarity threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
xeraa committed Mar 3, 2025
1 parent 9af387d commit e1be052
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/demo/elastic/rag/RagService.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public String queryLLM(String question) {
// Querying the vector store for documents related to the question
List<Document> vectorStoreResult =
vectorStore.doSimilaritySearch(SearchRequest.builder().query(question).topK(5)
.similarityThreshold(0.0).build());
.similarityThreshold(0.6).build());

// Merging the documents into a single string
String documents = vectorStoreResult.stream()
Expand Down

0 comments on commit e1be052

Please sign in to comment.