Multiple filed sorting does not work

mapping for the index

{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "type": "standard"
        }
      }
    }
  },
  "mappings": {
    "properties": {
      "category": {
        "type": "text",
        "analyzer": "standard"
      },
      "coordinates": {
        "type": "geo_point"
      },
      "businessHours": {
        "type": "nested",
        "properties": {
          "dayStartTime": {
            "type": "date"
          },
          "dayEndTime": {
            "type": "date"
          }
        }
      },
      "followersCount": {
        "type": "integer",
        "coerce": false
      },
      "averageRating": {
        "type": "float",
        "coerce": false
      },
      
    }
  }

sorting on multiple fields

sort=[
    {
      followersCount: {
        order: 'desc'
      }
    },
    {
      averageRating: {
        order: 'desc'
      }
    },
    {
      _geo_distance: {
        coordinates: [
          lng,
          lat
        ],
        order: "asc",
        unit: "km",
        distance_type: "arc",
        ignore_unmapped: true
      }
    },
  ]

Multiple filed sorting does not work

What do you mean by this? What results do you get and what do you expect to get?

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