You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "hossman (via GitHub)" <gi...@apache.org> on 2025/10/10 21:39:26 UTC

[I] VectorSimilarityFunction.getValues() does not implement doubleVal, throws UnsupportedOperationException [lucene]

hossman opened a new issue, #15328:
URL: https://github.com/apache/lucene/issues/15328

   ### Description
   
   `VectorSimilarityFunction` (and it's concrete subclasses) are the only `ValueSource` impls (AFAICT) that produce `FunctionValues` impls which _**do**_ override `floatVal(doc)` but do **NOT** override `doubleVal(doc)` -- so they inherits the default impl from the `FunctionValues` abstract class, throwing `UnsupportedOperationException`
   
   Practically speaking this means `VectorSimilarityFunction` subclasses are the only `ValueSource` impls (AFAICT) that _**can**_ be used in a `FunctionQuery`, but can **NOT** be used in a `FunctionScoreQuery` because `ValueSource.asDoubleValuesSource()` delegates to the `doubleVal(doc)`
   
   ### Version and environment details
   
   Affects main, and all previous versions of Lucene that contain `VectorSimilarityFunction`
   
   Fix (with tests) is fairly straight forward: [lucene.bug.VectorSimilarityFunction.doubleVal.patch.txt](https://github.com/user-attachments/files/22858305/lucene.bug.VectorSimilarityFunction.doubleVal.patch.txt)


-- 
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: issues-unsubscribe@lucene.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] VectorSimilarityFunction.getValues() does not implement doubleVal, throws UnsupportedOperationException [lucene]

Posted by "hossman (via GitHub)" <gi...@apache.org>.
hossman commented on issue #15328:
URL: https://github.com/apache/lucene/issues/15328#issuecomment-3393434235

   no, that's a stray comment left over from before i refactored the test ... ut wy didn't `./gradlew check` complain about that on my system???
   
   ...
   
   I guess the lucene build now requires some external tools to be installed?
   
   ```
   hossman@slate:~/lucene/lucene [j25] [*main] $ ./gradlew check -x test
   The ast-grep tool location is not set ('lucene.tool.ast-grep' option), will not apply ast-grep rules.
   The eclint tool location is not set ('lucene.tool.eclint' option), will not apply eclint checks.
   The eclint tool location is not set ('lucene.tool.eclint' option), will not apply eclint checks.
   
   > Task :errorProneSkipped
   Errorprone linting turned off (skipped on builds not running inside CI environments, pass -Pvalidation.errorprone=true to enable)
   
   [Incubating] Problems report is available at: file:///home/hossman/lucene/lucene/build/reports/problems/problems-report.html
   
   BUILD SUCCESSFUL in 4s
   ```


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] VectorSimilarityFunction.getValues() does not implement doubleVal, throws UnsupportedOperationException [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss closed issue #15328: VectorSimilarityFunction.getValues() does not implement doubleVal, throws UnsupportedOperationException
URL: https://github.com/apache/lucene/issues/15328


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] VectorSimilarityFunction.getValues() does not implement doubleVal, throws UnsupportedOperationException [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #15328:
URL: https://github.com/apache/lucene/issues/15328#issuecomment-3392957071

   Thanks, Hoss. There is a nocommit in this patch - is this intentional?


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] VectorSimilarityFunction.getValues() does not implement doubleVal, throws UnsupportedOperationException [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #15328:
URL: https://github.com/apache/lucene/issues/15328#issuecomment-3393650680

   Yes. ast-grep is an external tool but it's not difficult to install (on linux or mac). It's much, much faster than the regexps we used to have... and most folks would probably run github actions (on a pull request) which includes all the checks.


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [I] VectorSimilarityFunction.getValues() does not implement doubleVal, throws UnsupportedOperationException [lucene]

Posted by "dweiss (via GitHub)" <gi...@apache.org>.
dweiss commented on issue #15328:
URL: https://github.com/apache/lucene/issues/15328#issuecomment-3393651902

   See here -
   https://github.com/apache/lucene/blob/main/help/formatting.txt#L15-L43


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org