Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes related to the next Meilisearch release (v1.7.0) #520

Merged
merged 5 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ JSON output:
}
```

You can enable it by querying PATCH /experimental-features with { "scoreDetails": true }

This feature is only available with Meilisearch v1.3 and newer (optional).

#### Custom Search With attributes on at search time <!-- omit in toc -->
Expand Down
21 changes: 1 addition & 20 deletions spec/meilisearch/index/search/show_ranking_score_details_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,12 @@
RSpec.describe 'MeiliSearch::Index - Search with ranking score details' do
include_context 'search books with genre'

it 'experimental feature scoreDetails is not enabled so an error is raised' do
enable_score_details(false)

expect do
index.search('hobbit', { show_ranking_score_details: true })
end.to raise_error(MeiliSearch::ApiError)
end

it 'shows the ranking score details when showRankingScoreDetails is true' do
enable_score_details(true)

it 'shows the ranking score details' do
response = index.search('hobbit', { show_ranking_score_details: true })
expect(response['hits'][0]).to have_key('_rankingScoreDetails')
end

it 'hides the ranking score details when showRankingScoreDetails is false' do
enable_score_details(false)

response = index.search('hobbit', { show_ranking_score_details: false })
expect(response['hits'][0]).not_to have_key('_rankingScoreDetails')
end

it 'hides the ranking score details when showRankingScoreDetails is not set' do
enable_score_details(false)

response = index.search('hobbit')
expect(response['hits'][0]).not_to have_key('_rankingScoreDetails')
end
Expand Down
4 changes: 0 additions & 4 deletions spec/support/experimental_feature_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
require 'json'

module ExperimentalFeatureHelpers
def enable_score_details(toggle)
configure_feature('scoreDetails', toggle)
end

def enable_vector_store(toggle)
configure_feature('vectorStore', toggle)
end
Expand Down