The following query does not give any results when the from parameter is greater than 50. The number of hits also reduces as this parameter is gradulaly increased from 0. This works as expected if the query type is bool_prefix.
All the users have name in the following format: "test_n", e.g. test_1, test_2, test_3, etc. And search.name, search.email are of type search_as_you_type.
GET /users/_search
{
"query": {
"function_score": {
"query": {
"bool": {
"filter": [
{
"term": {
"status.name": "active"
}
},
{
"term": {
"organisation._id": "1"
}
}
],
"should": [
{
"multi_match": {
"boost": 1,
"query": "test_2",
"type": "phrase_prefix",
"fields": [
"search.name",
"search.email"
]
}
}
],
"minimum_should_match": 1
}
}
}
},
"size": 5,
"from": 50,
}