Skip to content
This repository has been archived by the owner on Mar 21, 2018. It is now read-only.

Commit

Permalink
feat(weight): Use more weight values in default weight
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelastic committed Nov 3, 2015
1 parent 31a0d2c commit 01f61fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion lib/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ def configure_index(index)
unordered(tags)
),
attributesToRetrieve: nil,
customRanking: ['desc(posted_at)', 'desc(weight)'],
customRanking: [
'desc(posted_at)',
'desc(weight.tag_name)',
'asc(weight.position)'
],
highlightPreTag: '<span class="algolia__result-highlight">',
highlightPostTag: '</span>'
}
Expand Down
6 changes: 5 additions & 1 deletion spec/push_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ def push.custom_hook_excluded_file?(_file)
expected = {
attributeForDistinct: 'url',
distinct: true,
customRanking: ['desc(posted_at)', 'desc(weight)']
customRanking: [
'desc(posted_at)',
'desc(weight.tag_name)',
'asc(weight.position)'
]
}
expect(index).to receive(:set_settings).with(hash_including(expected))

Expand Down

0 comments on commit 01f61fe

Please sign in to comment.