Class ConcatenationDocumentJoiner

java.lang.Object
org.springframework.ai.rag.retrieval.join.ConcatenationDocumentJoiner
All Implemented Interfaces:
Function<Map<Query,List<List<Document>>>,List<Document>>, DocumentJoiner

public class ConcatenationDocumentJoiner extends Object implements DocumentJoiner
Combines documents retrieved based on multiple queries and from multiple data sources by concatenating them into a single collection of documents. In case of duplicate documents, the first occurrence is kept. The score of each document is kept as is.
Since:
1.0.0
Author:
Thomas Vitale
  • Constructor Details

    • ConcatenationDocumentJoiner

      public ConcatenationDocumentJoiner()
  • Method Details

    • join

      public List<Document> join(Map<Query,List<List<Document>>> documentsForQuery)
      Description copied from interface: DocumentJoiner
      Joins documents retrieved across multiple queries and daa sources.
      Specified by:
      join in interface DocumentJoiner
      Parameters:
      documentsForQuery - a map of queries and the corresponding list of documents retrieved
      Returns:
      a single collection of documents