Skip to content

Commit

Permalink
fix(api): add a boost to article_id match (#970)
Browse files Browse the repository at this point in the history
* fix(data): update article id tokenizer

* fix(api): add a boost to article_id match

fix #936
  • Loading branch information
lionelB authored Jun 26, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 330748c commit 7b2ab7f
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ Object {
Object {
"_id": "8",
"_index": "cdtn_document_test",
"_score": 7.8337746,
"_score": 10.606363,
"_source": Object {
"slug": "r1225-18",
"source": "code_du_travail",
@@ -40,7 +40,7 @@ Object {
"_type": "cdtn_document_test",
},
],
"max_score": 7.8337746,
"max_score": 10.606363,
"total": 2,
},
}
Original file line number Diff line number Diff line change
@@ -27,7 +27,8 @@ function getFacetsBody({ query }) {
{
match: {
"title.article_id": {
query: query
query: query,
boost: 5
}
}
},
Original file line number Diff line number Diff line change
@@ -43,7 +43,8 @@ function getSearchBody({ query, size, excludeSources = [] }) {
{
match: {
"title.article_id": {
query: query
query: query,
boost: 5
}
}
},
2 changes: 1 addition & 1 deletion packages/code-du-travail-data/search/indexing/analysis.py
Original file line number Diff line number Diff line change
@@ -117,6 +117,6 @@
tokenizers = {
'article_id_tokenizer': {
'type': 'simple_pattern',
'pattern': '[LlRrDd].?[0123456789]{4}-[0123456789]{1,3}-?[0123456789]{1,3}?'
'pattern': '[0123456789]{4}[- ][0123456789]{1,3}[- ]?[0123456789]{1,3}?'
}
}

0 comments on commit 7b2ab7f

Please sign in to comment.