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

XMLparser drops user boosting

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1
    • 3.4, 4.0-ALPHA
    • None
    • None
    • 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

            uschindler Uwe Schindler
            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