After using MatchQuery and also trying TermQuery and FunctionScoreQuery I can say that Elasticsearch always produces NumericRangeQuery for numeric fields with boosting (or even for all numeric queries ???). fieldName = oa , value = 1 , boost = 400 E.g. "oa":"1" --> "oa":[1 to 1]
As for MatchQuery and TermQuery the boosting is doubled. E.g. "oa:1^400" --> ConstantScore(oa:[1 TO 1]^400.0)^400.0 The FunctionScoreQuery also produces a NumericRangeQuery but can handle the boost. E.g. "oa:1^400" --> ConstantScore(oa:[1 TO 1]) with "value" : 400.0, "static boost factor" By the way, this is how a working boosted numeric query should be (like in Solr): "oa:1^400" --> (MATCH) weight(oa:`\b\u0000\u0000\u0000\u0001^400.0 in ...) Regards Bernd Am Dienstag, 5. August 2014 09:19:18 UTC+2 schrieb Bernd Fehling: > > > Currently I'm playing with Solr 4.6.1 and ES 1.0.2 which both use Lucene > 4.6.1. > The field content of "oa" has very low cardinality, actually only one of > the values 0,1 or 2. > Also, in Solr I have omitNorms=true because I don't want any index-time > boost or anything else, and the precisionStep is zero. > Belief me, it works like a charm for years now with Solr and all is 100 > percent compliant to Lucene, the problem is Elasticsearch. > > I just wanted to implement boost-query to my ES interface as it is in Solr > for years. For example the boost should be if oa=1. > I don't know why I should deal with huge function score query if I just > want an extra boost during the query (selectable by the user). > > It seams like ES is not 100 Percent Lucene conform because it is not using > omitNorms=true on numeric fields :-( > The issue you mentioned is years ago and also fixed. > > Nevertheless the boosting problem of ES is somewhere in the QueryParsers > which transforms the result of QueryBuilders > to a Lucene query. > > > Am Montag, 4. August 2014 18:57:11 UTC+2 schrieb Jörg Prante: >> >> Because integer fields have no norms, it is quite uncommon to use them >> for boosting. More common is the use for interpreting integer values as >> input for scoring algorithm with function score. >> >> Which Solr version is this? Solr did not follow the Lucene default in >> previous versions regarding integer boosting >> https://issues.apache.org/jira/browse/SOLR-3140 >> >> Jörg >> >> >> >> -- You received this message because you are subscribed to the Google Groups "elasticsearch" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c1ade4e7-2499-4a05-9c0b-0b7eba1400a2%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
