Skip to content

Commit

Permalink
feat(api): improve searching for conventions by IDCC prefixes
Browse files Browse the repository at this point in the history
* feat(frontend): improve searching for conventions by IDCC prefixes

* use match_phrase_prefix instead of prefix

* improve IDCC suggestions by matching on non stemmed version of title

* update idcc snapshots
  • Loading branch information
adipasquale authored and lionelB committed Jul 1, 2019
1 parent d445952 commit 1e2aa84
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Object {
Object {
"_id": "10",
"_index": "cdtn_document_test",
"_score": 1.858978,
"_score": 1.8064516,
"_source": Object {
"id": "KALICONT000005635886",
"idcc": "843",
Expand All @@ -19,7 +19,7 @@ Object {
Object {
"_id": "11",
"_index": "cdtn_document_test",
"_score": 1.858978,
"_score": 1.7264521,
"_source": Object {
"id": "KALICONT000005635691",
"idcc": "1747",
Expand All @@ -30,7 +30,7 @@ Object {
"_type": "cdtn_document_test",
},
],
"max_score": 1.858978,
"max_score": 1.8064516,
"total": 2,
}
`;
Expand All @@ -57,7 +57,7 @@ Object {
Object {
"_id": "10",
"_index": "cdtn_document_test",
"_score": 1.6673176,
"_score": 0.57498115,
"_source": Object {
"id": "KALICONT000005635886",
"idcc": "843",
Expand All @@ -70,7 +70,7 @@ Object {
Object {
"_id": "11",
"_index": "cdtn_document_test",
"_score": 1.6673176,
"_score": 0.57498115,
"_source": Object {
"id": "KALICONT000005635691",
"idcc": "1747",
Expand All @@ -81,7 +81,7 @@ Object {
"_type": "cdtn_document_test",
},
],
"max_score": 1.6673176,
"max_score": 0.57498115,
"total": 2,
}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ function getIdccBody({ query }) {
}
},
{
multi_match: {
query: `${query}`,
fields: "idcc.*"
match_phrase_prefix: {
"idcc.text": {
query: `${query}`
}
}
},
{
match_phrase_prefix: {
"title.french_stemmed": {
title: {
query: `${query}`
}
}
Expand Down

0 comments on commit 1e2aa84

Please sign in to comment.