Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3347

XMLparser drops user boosting

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.4, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      The lucene XML parser seems to convert user defined boosting back to default 1.0 and thus boosting value is dropped from the query...

      e.g.

      <BooleanQuery>
      	<Clause occurs="must">
      		<BooleanQuery>
      			<Clause occurs="should">
      				<UserQuery fieldName="Vehicle.Colour">red^66 blue~^8</UserQuery>
      			</Clause>
      		</BooleanQuery>
      	</Clause>
      	<Clause occurs="should">
      		<BooleanQuery>
      			<Clause occurs="should">
      				<UserQuery fieldName="Vehicle.Colour">black^0.01</UserQuery>
      			</Clause>
      		</BooleanQuery>
      	</Clause>
      </BooleanQuery>
      

      produces a lucene query: +( ( Vehicle.Colour:red^66 Vehicle.Colour:blue~0.5^8 ) ) ( Vehicle.Colour:black )

      The expected query : +( ( Vehicle.Colour:red^66 Vehicle.Colour:blue~0.5^8 ) ) ( Vehicle.Colour:black^0.01 )

      I have developed a work around by modifying line 77 of UserInputQueryBuilder.java

      from:

      q.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
      

      to:

      q.setBoost( DOMUtils.getAttribute( e, "boost", q.getBoost() ) );
      

        Attachments

        1. LUCENE-3347.patch
          2 kB
          Uwe Schindler

          Activity

            People

            • Assignee:
              uschindler Uwe Schindler
              Reporter:
              moogie moogie
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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