serhiy-bzhezytskyy opened a new pull request, #179: URL: https://github.com/apache/solr-orbit/pull/179
A converted `function_score` whose one function was a Lucene expression (`script_score`, `lang: expression`) became `q=*:*`. Solr evaluates the same expressions with `ExpressionValueSourceParser`, but only as a function registered in `solrconfig.xml`, and its variables are field names. The converter now: - registers the expression as `custom_func_<operation name>`, with each `doc['f']` as a positional argument, and calls it from the operation; - for `doc['g'].lat` / `.lon`, adds `g_lat` / `g_lon` doc-values fields to the schema and an update chain that fills them from `g` when a document is indexed, so the corpus stays as it is. `_score` is the inner query's score for each document (`DoubleValuesSource.SCORES`). Over `match_all` it is 1.0 for every document, so a `_score` factor is dropped. Over any other query the inner query is passed as `qq`: it selects the documents, its score of each document reaches the expression as an argument in place of `_score`, and `boost_mode` combines it with the function's value as OpenSearch does. An expression that uses anything other than fields, numbers and Lucene's default functions stays untranslated. On Solr 10.1.0, a collection built from the converted geonames config set with 50,000 documents indexed as they are gets both derived fields on every document. Over 300 of them the operation's scores match OpenSearch's upstream expression to a relative 1.3e-07. Over an inner query whose score is 1 or 2 by document (two `range` clauses in a `bool` `should`, scored the same by both engines), all six `boost_mode`s and a `_score` used as a term match OpenSearch on 300 of 300 documents, to 5.1e-07 or better. The new tests fail without the change. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
