Sorted index query time is same as unsorted index

I have a sorted index based on profile_created_time.
When I query to the index when index sorting enabled and disabled . Query time is same.

Can someone help what is wrong with my query.

{
  "size": 20,
  "from": 0,
  "sort": [
    {
      "profile_created_time": {
        "order": "desc"
      }
    }
  ],
  "query": {
    "bool": {
      "filter": {
        "bool": {
          "should": [
            {
              "friend": {
                "status": "online"
              }
            }
          ]
        }
      },
      "must": {
        "dis_max": {
          "queries": [
            {
              "bool": {
                "boost": 0.1,
                "must": {
                  "constant_score": {
                    "filter": {
                      "match_phrase": {
                        "name": {
                          "query": "andy"
                        }
                      }
                    }
                  }
                }
              }
            },
            {
              "simple_query_string": {
                "auto_generate_synonyms_phrase_query": false,
                "default_operator": "and",
                "fields": [
                  "name^0.000000",
                  "nickname^0.000000"
                ],
                "query": "andy"
              }
            }
          ],
          "tie_breaker": 0
        }
      }
    }
  }
}

first, can you check that the index sort order is the same in the mapping?

second, you can use the profile API - or to simplify things, use the kibana profiler, which leverages that API, to check where the time of your query is spent.

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