'ranking' => [
// Place the `asc` and `desc` modifiers at the top // if you're configuring an index just for sorting
'asc(attribute1)',
'desc(attribute2)',
'typo',
'geo',
'words',
'filters',
'proximity',
'attribute',
'exact',
'custom'
]
ranking: [
# Place the `asc` and `desc` modifiers at the top # if you're configuring an index just for sorting
'asc(attribute1)',
'desc(attribute2)',
'typo',
'geo',
'words',
'filters',
'proximity',
'attribute',
'exact',
'custom'
]
ranking: [
// Place the `asc` and `desc` modifiers at the top // if you're configuring an index just for sorting
'asc(attribute1)',
'desc(attribute2)',
'typo',
'geo',
'words',
'filters',
'proximity',
'attribute',
'exact',
'custom'
]
'ranking': [
# Place the `asc` and `desc` modifiers at the top # if you're configuring an index just for sorting
'asc(attribute1)',
'desc(attribute2)',
'typo',
'geo',
'words',
'filters',
'proximity',
'attribute',
'exact',
'custom'
]
ranking = [
// Place the `asc` and `desc` modifiers at the top // if you're configuring an index just for sorting
.asc("attribute1"),
.desc("attribute2"),
.typo,
.geo,
.words,
.filters,
.proximity,
.attribute,
.exact,
.custom
]
IndexSettings settings = new IndexSettings();
settings.Ranking = new List<string>
{
// Place the `asc` and `desc` modifiers at the top // if you're configuring an index just for sorting
"asc(attribute1)",
"desc(attribute2)",
"typo",
"geo",
"words",
"filters",
"proximity",
"attribute",
"exact",
"custom",
};
.setRanking(Arrays.asList(
// Place the `asc` and `desc` modifiers at the top // if you're configuring an index just for sorting
"asc(attribute1)",
"desc(attribute2)",
"typo",
"geo",
"words",
"filters",
"proximity",
"attribute",
"exact",
"custom",
))
opt.Ranking(
// Place the `asc` and `desc` modifiers at the top // if you're configuring an index just for sorting
"asc(attribute1)",
"desc(attribute2)",
"typo",
"geo",
"words",
"filters",
"proximity",
"attribute",
"exact",
"custom",
)
ranking = Some(Seq(
// Place the `asc` and `desc` modifiers at the top // if you're configuring an index just for sorting
Ranking.asc("price"),
Ranking.desc("price"),
Ranking.typo,
Ranking.geo,
Ranking.words,
Ranking.filters,
Ranking.proximity,
Ranking.attribute,
Ranking.exact,
Ranking.custom
))
If custom isn’t defined, customRanking is ignored.
Modifiers
asc
Sort in ascending order (lowest to highest).
desc
Sort in descending order (highest to lowest).
Examples
Set ranking
This example sets the ranking criteria for an index.
It’s slightly different to Algolia’s default ranking since it swaps the order of attribute and proximity.