# Questions about LTR rescore

**URL:** <https://discuss.elastic.co/t/questions-about-ltr-rescore/371972>\
**Category:** Elastic Search\
**Created:** [December 13, 2024, 8:44pm UTC](https://discuss.elastic.co/t/questions-about-ltr-rescore/371972 "2024-12-13T20:44:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yulinxp1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yulinxp1/32/140021_2.png) [@yulinxp1](https://discuss.elastic.co/u/yulinxp1)\
**Post date:** [December 13, 2024, 8:44pm UTC](https://discuss.elastic.co/t/questions-about-ltr-rescore/371972/1 "2024-12-13T20:44:10Z")

</div>

Questions about LTR rescore on this document

> **[Search using Learning To Rank | Elasticsearch Guide \[8.17\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/learning-to-rank-search-usage.html#learning-to-rank-rescorer-limitations)**

1. According to 'window\_size \>= from + size', for page\_size: 10,

```auto
* Page 1: `from = 0`, window_size >= 10
* Page 2: `from = 10`, window_size >= 20
* Page 3: `from = 20`, window_size >= 30

```

According to the pagination limitation, we should use same 30 even for the 1st page?

1. Is it possible to use _search\_after_ in first pass query?

2. "query\_text" is incorrect. It should be "query"

```auto
      "params": { 
        "query_text": "the quick brown fox"
      }

```

---

<div class="post-metadata">

**Author:** ![atul\_mohan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/atul_mohan/32/137776_2.png) [@atul\_mohan](https://discuss.elastic.co/u/atul_mohan)\
**Post date:** [December 31, 2024, 12:29am UTC](https://discuss.elastic.co/t/questions-about-ltr-rescore/371972/2 "2024-12-31T00:29:35Z")

</div>

```auto
{
  "query": {
    "match": {
      "field": "some_field"
    }
  },
  "sort": [
    {"_score": "desc"},
    {"some_unique_field": "asc"} // assuming 'some_unique_field' is unique for each document
  ],
  "search_after": ["previous_score", "previous_unique_value"], // Example values
  "size": 10,
  "rescore": {
    "window_size": 30,
    "query": {
      "rescore_query": {
        "sltr": {
          "model_id": "ltr-model",
          "params": {
            "query": "the quick brown fox"
          }
        }
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 28, 2025, 12:29am UTC](https://discuss.elastic.co/t/questions-about-ltr-rescore/371972/3 "2025-01-28T00:29:51Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
