When retrieving data from the Ardor api, why is the data returned not in chronological order?
-
1Which API call are you doing exactly? It's supposed to be in reverse chronological order: nxtwiki.org/wiki/The_Nxt_API#Get_All_Tagged_Data– MrVCommented Oct 10, 2018 at 20:35
-
searchTaggedData– Patoshi パトシCommented Oct 10, 2018 at 20:36
-
It's not in any order it seems: prnt.sc/l4ln1k– Patoshi パトシCommented Oct 10, 2018 at 20:42
2 Answers
The results are first ordered by the score which Apache Lucene assigns to them . If two results get same score, they are ordered by blockTimestamp
, descending (what happens with the 2nd, 3rd and 4th result in your data).
Apache Lucene is configured with the default BM25Similarity with parameters k1 = 1.2 b = 0.75, i.e. Ardor uses the default scoring function. More details about that function can be found here. The query parser is configured with default operator AND
, so if your query contains two words, they must both be present in order for the data to be included in the result
From petko:
They are ordered by ScoreDoc.score
- see https://lucene.apache.org/core/7_2_1/core/index.html?org/apache/lucene/search/ScoreDoc.html