This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects

Resolve "Relevance Ranking in Metadata"

Merged Philipp Gritsch requested to merge 439-relevance-ranking-in-metadata into development
Viewing commit 636541f2
Show latest version
1 file
+ 23
0
Compare changes
  • Side-by-side
  • Inline
@@ -594,6 +594,29 @@ public class MetaDataRepository {
}
private List<SortOptions> getDefaultSortStrategy() {
/** todo try this
* GET /my_index/_search
* {
* "query": {
* "match_all": {}
* },
* "sort": {
* "_script": {
* "type": "number",
* "script": {
* "lang": "painless",
* "source": "doc['fieldA'].value * params.factorA + doc['fieldB'].value * params.factorB",
* "params": {
* "factorA": 1.0,
* "factorB": 100.0
* }
* },
* "order": "desc"
* }
* }
* }
*/
return List.of(
getSortOptionForFieldAndOrder(SearchRepositoryConstants.SEARCHSTATISTICS_BADGEREWARDED, SortOrder.Desc, FieldType.Boolean),
getSortOptionForFieldAndOrder(SearchRepositoryConstants.SEARCHSTATISTICS_DOWNLOADS, SortOrder.Desc, FieldType.Integer),