function-query

Query to View only top counts and counted by group

筅森魡賤 提交于 2020-01-16 18:12:07
问题 I wanted to use this query =query(G2:I80,"select G,H,I where H=max(H) group by I",-1) From this: Cdd Cts T NWH 4 A1 LBB 3 A1 MP 3 A1 DC 2 A1 AK 10 A10 CC 3 A10 SC 2 A11 JL 1 A11 VT 1 A11 To This: T Cdd Cts A1 NWH 4 A10 AK 10 A11 SC 2 Am I doing it right? Or I have to come up with something to manually count them? 回答1: Try =ArrayFormula(iferror(vlookup(unique(I2:I), sort({I2:I, G2:H},3,), {1,2,3},0))) and see if that works for you ? How does it work: 1: with sort() a new 'virtual' table is

Solr Function Query : How to use “score” field for creating custom scoring

℡╲_俬逩灬. 提交于 2019-12-19 05:45:15
问题 After searching extensively and coming across answers such as these - Solr: Sort by score & an int field value Use function query for boosting score in Solr I am still unable to solve the following problem : How do I use the "score" field of a document to create a new scoring function and rank the results accordingly . Something like this - new_score = score * my_other_field Current Query - http://localhost:8984/solr/suggest_new/select?q=tom&wt=json&indent=true&bq=_val_:"product(score,count

How can I multiply the score of two queries together in Elasticsearch?

橙三吉。 提交于 2019-12-19 03:23:00
问题 In Solr I can use the query function query to return a numerical score for a query and I can user that in the context of a bf parameter something like bf=product(query('cat'),query('dog')) to multiply two relevance scores together. Elasticsearch has search API that is generally more flexible to work with, but I can't figure out how I would accomplish the same feat. I can use _score in a script_function of a function_query but I can only user the _score of the main query. How can I incorporate

Is there a way to make this type of query work?

大兔子大兔子 提交于 2019-12-13 06:52:16
问题 =query(G2:I80,"select G,H,I where H=max(H) group by I",-1) Columnn G is names Column H is vote count and Column I is Their respective teams. I want to view the top voted names of each team and sometimes the some top voted names are tied so I wanna view both names using the query above but it dont seem to work. 回答1: I am not entirely sure what you want (a formula that does not work is not a good guide) but perhaps: =sort(filter(query(G2:I80,"select G, H, I ",-1),H2:H80=Max(H:H)),3,TRUE) 来源:

How can I multiply the score of two queries together in Elasticsearch?

情到浓时终转凉″ 提交于 2019-11-30 21:41:22
In Solr I can use the query function query to return a numerical score for a query and I can user that in the context of a bf parameter something like bf=product(query('cat'),query('dog')) to multiply two relevance scores together. Elasticsearch has search API that is generally more flexible to work with, but I can't figure out how I would accomplish the same feat. I can use _score in a script_function of a function_query but I can only user the _score of the main query. How can I incorporate the score of another query? How can I multiply the scores together? You could script a TF*IDF scoring