paulirwin commented on issue #1157: URL: https://github.com/apache/lucenenet/issues/1157#issuecomment-3222469446
@ldqk After an investigation and testing, the MultiFieldQueryParser boost functionality seems to be working correctly in both 4.8.0-beta00017 and latest master. I created a test case that verifies both the query string representation and actual document scoring with different boost values. The test confirms that when different boost values are applied to fields, the resulting document scores do change accordingly. Documents matching in fields with higher boost values receive proportionally higher scores, which is the expected behavior. The test demonstrates that when setting a boost of 2.0f for the "title" field and 1.0f for the "keyword" field, documents with matches in the title field score higher than when the boosts are reversed. So it does seem to be working as expected. During the investigation, I did identify and fix a minor issue where the boost dictionary was accessed directly without checking if the key exists first, which could potentially cause exceptions in certain scenarios. This has been corrected to use TryGetValue for safer dictionary access. The boost functionality in Lucene.NET appears to be working identically to the Java Lucene 4.8.1 implementation. If you're still experiencing issues with boost values not affecting scores, please verify that the boost dictionary is being properly initialized with the correct field names that match exactly with the fields being searched, as field name mismatches would result in boosts not being applied. Or please provide a more comprehensive example demonstrating what exactly does not work as expected. Thanks! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
