Interface DocumentJoiner

All Superinterfaces:
Function<Map<Query,List<List<org.springframework.ai.document.Document>>>,List<org.springframework.ai.document.Document>>
All Known Implementing Classes:
ConcatenationDocumentJoiner

public interface DocumentJoiner extends Function<Map<Query,List<List<org.springframework.ai.document.Document>>>,List<org.springframework.ai.document.Document>>
A component for combining documents retrieved based on multiple queries and from multiple data sources into a single collection of documents. As part of the joining process, it can also handle duplicate documents and reciprocal ranking strategies.
Since:
1.0.0
Author:
Thomas Vitale
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<org.springframework.ai.document.Document>
    apply(Map<Query,List<List<org.springframework.ai.document.Document>>> documentsForQuery)
     
    List<org.springframework.ai.document.Document>
    join(Map<Query,List<List<org.springframework.ai.document.Document>>> documentsForQuery)
    Joins documents retrieved across multiple queries and daa sources.

    Methods inherited from interface java.util.function.Function

    andThen, compose
  • Method Details

    • join

      List<org.springframework.ai.document.Document> join(Map<Query,List<List<org.springframework.ai.document.Document>>> documentsForQuery)
      Joins documents retrieved across multiple queries and daa sources.
      Parameters:
      documentsForQuery - a map of queries and the corresponding list of documents retrieved
      Returns:
      a single collection of documents
    • apply

      default List<org.springframework.ai.document.Document> apply(Map<Query,List<List<org.springframework.ai.document.Document>>> documentsForQuery)
      Specified by:
      apply in interface Function<Map<Query,List<List<org.springframework.ai.document.Document>>>,List<org.springframework.ai.document.Document>>