I created a facet using Query Options, as shown below.
"constraint": [
{
"name": "Full Name",
"range":
{
"type": "xs:string",
"element": {"name": "Full Name" }
}
}
]
I see that the "Full Name" properties are returned in sorted order under "facet" property and also, we can control the sort order (ascending vs descending).
"facets": {
"Full Name": {
"type": "xs:string",
"facetValues": [
{
"name": "John H",
"count": 1,
"value": "John H"
},
{
"name": "Mary",
"count": 1,
"value": "Mary"
}
]
}
}
But, my requirement is to sort the names based on role first and then names. For example, John is HR and Mary is an accountant, so Mary should appear before John as her role (accountant) precedes John's role (HR) in the sort order. Is there a way I can sort the indexed constraint by additional properties?
One way I heard, is to create a composite property (role+Name) and create a range index on the composite property. Is it suggested approach?