Skip to content
Solr component that surfaces payloads for matching terms
Java
Branch: master
Clone or download
Latest commit aacbbac Oct 22, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Build out payloads response with offsets information. Oct 22, 2019
.gitignore WIP, initial commit Aug 20, 2019
LICENSE Create LICENSE Sep 17, 2019
README.md point to the demo app Sep 24, 2019
pom.xml Version bump Oct 22, 2019

README.md

payload-component

This component plugin will return the payloads for terms that matched in your query.

Example document:

{
  "id": "my sample doc",
  "payload_content": "Look|ignored at this|wow"
}

Querying for payload_content:this would generate a response like the following:

{
  "response":{
    "docs":[
      {
        "id":"my sample doc",
        "payload_content":"Look|ignored at this|wow",
      }
    ]
  },
  "payloads":{
    "my sample_doc":{
      "payload_content":{
        "this":[
          "wow"
        ]
      }
    }
  }
}     

Since wow was a payload of the this token, and this was in the query, wow comes back in the payloads response.

Why?

This project was originally conceived as a solution for storing bounding boxes with terms for OCR highlighting.

See it in action at http://github.com/o19s/pdf-discovery-demo.

Requirements

  • Solr 7.x
  • A field type that utilizes payloads

Usage

Building

Building requires JDK 8 and Maven. Once you're setup just run:

mvn package to generate the latest jar in the target folder.

Todo

  • Support later Solr versions
  • Allow for passing in custom fields to match against
  • Support some basic term statistics in the response
You can’t perform that action at this time.