Class MemoryIndexChunkScorer

java.lang.Object
org.elasticsearch.xpack.core.common.chunks.MemoryIndexChunkScorer

public class MemoryIndexChunkScorer extends Object
Utility class for scoring pre-determined chunks using an in-memory Lucene index.
  • Constructor Details

    • MemoryIndexChunkScorer

      public MemoryIndexChunkScorer()
  • Method Details

    • scoreChunks

      public List<MemoryIndexChunkScorer.ScoredChunk> scoreChunks(List<String> chunks, String inferenceText, int maxResults) throws IOException
      Creates an in-memory index of chunks, or chunks, returns ordered, scored list.
      Parameters:
      chunks - the list of text chunks to score
      inferenceText - the query text to compare against
      maxResults - maximum number of results to return
      Returns:
      list of scored chunks ordered by relevance
      Throws:
      IOException - on failure scoring chunks