Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-14787

Inequality support in Payload Check query parser

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Implemented
    • None
    • 9.0
    • None
    • None

    Description

      The goal of this ticket/pull request is to support a richer set of matching and filtering based on term payloads.  This patch extends the PayloadCheckQueryParser to add a new local param for "op"

      The value of OP could be one of the following

      • gt - greater than
      • gte - greater than or equal
      • lt - less than
      • lte - less than or equal

      default value for "op" if not specified is to be the current behavior of equals.

      Additionally to the operation you can specify a threshold local parameter

      This will provide the ability to search for the term "cat" so long as the payload has a value of greater than 0.75.  

      One use case is to classify a document into various categories with an associated confidence or probability that the classification is correct.  That can be indexed into a delimited payload field.  The searches can find and match documents that were tagged with the "cat" category with a confidence of greater than 0.5.

      Example Document

      { 
        "id":"doc_1",
        "classifications_payload":["cat|0.75 dog|2.0"]
      }
      

      Example Syntax

      {!payload_check f=classifications_payload payloads='1' op='gt' threshold='0.5'}cat  

       

       

       

       

      Attachments

        Issue Links

          Activity

            People

              gus Gus Heck
              kwatters Kevin Watters
              Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m