<p>The results are first ordered by the <a href="https://lucene.apache.org/core/7_1_0/core/org/apache/lucene/search/package-summary.html#scoring" rel="nofollow noreferrer">score which Apache Lucene assigns to them</a> . If two results get same score, they are ordered by <code>blockTimestamp</code>, descending (what happens with the 2nd, 3rd and 4th result in your data).</p>

<p>Apache Lucene is configured with the default <a href="https://lucene.apache.org/core/7_1_0/core/org/apache/lucene/search/similarities/BM25Similarity.html" rel="nofollow noreferrer">BM25Similarity</a> with parameters k1 = 1.2 b = 0.75, i.e. Ardor uses the default scoring function. More details about that function can be found <a href="https://en.wikipedia.org/wiki/Okapi_BM25" rel="nofollow noreferrer">here</a>. The query parser is configured with <a href="https://lucene.apache.org/core/7_1_0/queryparser/org/apache/lucene/queryparser/classic/QueryParserBase.html#setDefaultOperator-org.apache.lucene.queryparser.classic.QueryParser.Operator-" rel="nofollow noreferrer">default operator</a> <code>AND</code>, so if your query contains two words, they must both be present in order for the data to be included in the result</p>

CC BY-SA 4.0
2018-10-11T17:35:14.117Z
2018-10-11T17:35:14.117Z
Petko Petkov
<p>From petko:</p>

<p>They are ordered by <code>ScoreDoc.score</code> - see <a href="https://lucene.apache.org/core/7_2_1/core/index.html?org/apache/lucene/search/ScoreDoc.html" rel="nofollow noreferrer">https://lucene.apache.org/core/7_2_1/core/index.html?org/apache/lucene/search/ScoreDoc.html</a></p>

CC BY-SA 4.0
2018-10-11T16:15:49.780Z
2018-10-11T16:15:49.780Z
MrV
<p>When retrieving data from the Ardor api, why is the data returned not in chronological order? </p>

<p><a href="https://i.sstatic.net/QYiFq.png" rel="noreferrer"><img src="https://i.sstatic.net/QYiFq.png" alt="enter image description here"></a></p>

CC BY-SA 4.0
2018-10-10T20:35:36.483Z
Which API call are you doing exactly? It's supposed to be in reverse chronological order: https://nxtwiki.org/wiki/The_Nxt_API#Get_All_Tagged_Data
MrV
CC BY-SA 4.0
2018-10-10T20:36:18.183Z
searchTaggedData
Patoshi パトシ
CC BY-SA 4.0
2018-10-10T20:42:58.703Z
It's not in any order it seems: https://prnt.sc/l4ln1k
Patoshi パトシ
<ardor>
Why are ardor transactions called via the api not in chronological order by timestamp?
Patoshi パトシ
# Why are ardor transactions called via the api not in chronological order by timestamp?

(Asked by: username_0 on 2018-10-10)

When retrieving data from the Ardor api, why is the data returned not in chronological order?

[![enter image description here](https://i.sstatic.net/QYiFq.png)](https://i.sstatic.net/QYiFq.png)

**Tags:** ardor

> **Comments:**
> **username_1**: Which API call are you doing exactly? It's supposed to be in reverse chronological order: https://nxtwiki.org/wiki/The_Nxt_API#Get_All_Tagged_Data  
> **username_0**: searchTaggedData  
> **username_0**: It's not in any order it seems: https://prnt.sc/l4ln1k  

---

## 2 answers

### Answer by username_2 on 2018-10-11. Score: 3 | Accepted answer

The results are first ordered by the [score which Apache Lucene assigns to them](https://lucene.apache.org/core/7_1_0/core/org/apache/lucene/search/package-summary.html#scoring) . 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](https://lucene.apache.org/core/7_1_0/core/org/apache/lucene/search/similarities/BM25Similarity.html) 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](https://en.wikipedia.org/wiki/Okapi_BM25). The query parser is configured with [default operator](https://lucene.apache.org/core/7_1_0/queryparser/org/apache/lucene/queryparser/classic/QueryParserBase.html#setDefaultOperator-org.apache.lucene.queryparser.classic.QueryParser.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


---

### Answer by username_1 on 2018-10-11. Score: 1

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>


---

