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

Score details #252

Merged
merged 6 commits into from
Jul 31, 2023
Merged

Score details #252

merged 6 commits into from
Jul 31, 2023

Conversation

dureuill
Copy link
Contributor

@dureuill dureuill commented Jul 4, 2023

🤖 API Diff Put the link of the GitHub comment generated by bump.sh if generated; Apply the OpenApi label


Summary

Specify the ranking score and ranking score details.

Specification for meilisearch/meilisearch#3771


Changes

  • Add new ranking score specification
  • Update search API with the new query parameters and the new fields added to returned documents
  • Update telemetry
  • Update Open API

Out Of Scope

N/A


Attention To Reviewers

  • This PR references the "experimental features" spec, and so is based on the experimental_features branch rather than the release-v1.3.0 branch. When merging, make sure to merge Experimental features #250 before this PR.

Misc

  • Update OpenAPI specification file (if needed; Apply the OpenApi label)
  • Update telemetry datapoints (if needed; Apply the Telemetry label)

@dureuill dureuill added Ready For Review Feature specification must be reviewed. Implemented Feature specification has been implemented. OpenAPI Update OpenAPI specification. Telemetry Update the telemetry collect. 🧪 Experimental The PR describes an experimental feature. v1.3.0 labels Jul 4, 2023
text/0118-search-api.md Outdated Show resolved Hide resolved
@dureuill dureuill force-pushed the score_details branch 3 times, most recently from 2d7f6ab to 18e6e01 Compare July 4, 2023 09:49
text/0195-ranking-score.md Outdated Show resolved Hide resolved
text/0195-ranking-score.md Outdated Show resolved Hide resolved
text/0195-ranking-score.md Outdated Show resolved Hide resolved
text/0195-ranking-score.md Outdated Show resolved Hide resolved
Co-authored-by: Maria Craig <marycraig90@gmail.com>
@macraig macraig mentioned this pull request Jul 5, 2023
1 task
meili-bors bot added a commit to meilisearch/meilisearch that referenced this pull request Jul 10, 2023
3906: Add "scoring.*" analytics to multi search route r=Kerollmops a=dureuill

# Pull Request

## Related issue
Fixes meilisearch/specifications#252 (comment) by implementing (3): multi search now returns the "score.show_ranking_rule" and "score.show_ranking_rule_details" analytics.


Co-authored-by: Louis Dureuil <louis@meilisearch.com>
@@ -191,6 +191,8 @@ The collected data is sent to [Segment](https://segment.com/). Segment is a plat
| `clear_all` | `true` if `DELETE /indexes/:indexUid/documents` endpoint was used in this batch, otherwise `false` | false | `Documents Deleted` |
| vector_store | Whether the [vector store](./0193-experimental-features.md#vector-store) feature is enabled. | `true` | `Experimental features Updated` |
| score_details | Whether the [score details](./0193-experimental-features.md#score-details) feature is enabled. | `true` | `Experimental features Updated` |
| scoring.show_ranking_score | Was `showRankingScore` used in the aggregated event? If yes, `true`, otherwise `false` | `false` | `Documents Searched POST`, `Documents Searched GET`, `Documents Searched by Multi-Search POST` |
| scoring.show_ranking_score_details | Was `showRankingScoreDetails` used in the aggregated event? If yes, `true`, otherwise `false` | `false` | `Documents Searched POST`, `Documents Searched GET`, `Documents Searched GET` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| scoring.show_ranking_score_details | Was `showRankingScoreDetails` used in the aggregated event? If yes, `true`, otherwise `false` | `false` | `Documents Searched POST`, `Documents Searched GET`, `Documents Searched GET` |
| scoring.show_ranking_score_details | Was `showRankingScoreDetails` used in the aggregated event? If yes, `true`, otherwise `false` | `false` | `Documents Searched POST`, `Documents Searched GET`, `Documents Searched by Multi-Search POST` |

🥅

The score is given by the following formula, assuming `n` ranking rules denoted from `0` to `n-1`:

```
score = sum(i in 0..(n-1), (rank_i - 1) / product(j in 0..=i, max_rank_j)) + (rank_(n-1) / product(i in 0..n, max_rank_i))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DWy9tioW0AARLPA

},
"attribute": {
"order": 3,
"attributes_ranking_order": 0.8333333333333334,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be written attributesRankingOrder to follow the camelCase field naming convention ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea Louis was onto me today about this. It looks like the implementation is outputting it with underscores rather than camelCase so will need a change there first (and then an update here and in the blog post to make sure they are the same). I'll create an issue on the project as a start point.

Copy link

@gillian-meilisearch gillian-meilisearch Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue created here: meilisearch/meilisearch#3941

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya!
Here is the PR on Meilisearch fixing it https://github.com/meilisearch/meilisearch/pull/3949/files, however, there is a difference in the name chosen on Meilisearch side and in the spec:
attributeRankingOrderScore vs attributesRankingOrder and queryWordDistanceScore and attributesQueryWordOrder, which names should be chosen?

@gmourier

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey many 👋👶

attributeRankingOrderScore and queryWordDistanceScore

Relevant discussion (internal link)

"attribute": {
"order": 3,
"attributes_ranking_order": 0.8333333333333334,
"attributes_query_word_order": 1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

☝️

@macraig macraig merged commit 1d6afe2 into experimental_features Jul 31, 2023
1 check passed
@macraig macraig deleted the score_details branch July 31, 2023 10:25
macraig added a commit that referenced this pull request Jul 31, 2023
* Fix various typos

* Fix wrongly tagged routes in open api

* Telemetry policy

* Add new error and api keys actions

* Add experimental features and experimental feature API specs

* Update open API

* Score details (#252)

* ranking score spec

* search API changes

* telemetry policies score

* open api

* Fix typos in spec

Co-authored-by: Maria Craig <marycraig90@gmail.com>

* Add multi search telemetry

---------

Co-authored-by: Maria Craig <marycraig90@gmail.com>

---------

Co-authored-by: Maria Craig <marycraig90@gmail.com>
This was referenced Aug 8, 2023
properties:
order:
$ref: '#/components/schemas/order'
attribute_ranking_order_score:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dureuill @brunoocasali this attribute should be attributeRankingOrderScore ?
also query_word_distance_score => queryWordDistanceScore

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧪 Experimental The PR describes an experimental feature. Implemented Feature specification has been implemented. OpenAPI Update OpenAPI specification. Ready For Review Feature specification must be reviewed. Telemetry Update the telemetry collect. v1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants