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

constant score query syntax

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.1, 6.0
    • None
    • None

    Description

      A ConstantScoreQuery is like a boosted query, but it produces the same score for every document that matches the query. The score produced is equal to the query boost. The ^= operator is used to turn any query clause into a ConstantScoreQuery.

      Constant Score Query Examples:

      +color:blue^=1 text:shoes
      (inStock:true text:heliosearch)^=100 native code faceting
      

      Syntax rational: since boosting (multiplication) is term^value, the syntax for having a constant score can be term^=value

      Attachments

        1. SOLR-7218.patch
          10 kB
          Yonik Seeley

        Activity

          People

            yseeley@gmail.com Yonik Seeley
            yseeley@gmail.com Yonik Seeley
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: