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

feat(api): add ES score #197

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/src/__tests__/__snapshots__/api.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Object {
"highlightLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN",
"label": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN",
"matching": 133,
"score": 12.817251,
"simpleLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN",
"siren": "855200507",
}
Expand Down Expand Up @@ -92,6 +93,7 @@ Object {
"label": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN",
"libelleCommuneEtablissement": "LYON 3EME",
"matching": 1,
"score": 16.958105,
"simpleLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN",
"siren": "855200507",
"siret": "85520050703169",
Expand Down Expand Up @@ -361,6 +363,7 @@ Object {
"highlightLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES <b><u>MICHELIN</u></b>",
"label": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN",
"matching": 18,
"score": 21.91652,
"simpleLabel": "MANUFACTURE FRANCAISE DES PNEUMATIQUES MICHELIN",
"siren": "855200507",
}
Expand Down
2 changes: 2 additions & 0 deletions api/src/elastic/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const mapHit =
libelleCommuneEtablissement,
codePaysEtrangerEtablissement,
},
_score,
inner_hits,
highlight,
}: any) => {
Expand Down Expand Up @@ -169,6 +170,7 @@ export const mapHit =
highlightLabel,
label,
matching,
score: _score,
simpleLabel,
siren,
};
Expand Down