Skip to content

Commit a68a7f1

Browse files
author
Jerry
committed
Change query factors
1 parent cdf6567 commit a68a7f1

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/pipeline.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@ def default_string_query(self, q, options):
2525
"query": {
2626
"dis_max": {
2727
"queries": [
28-
{"term": {"info.title": {"value": q, "boost": 2.0}}},
28+
{"term": {"_id": {"value": q, "boost": 10}}},
29+
{"term": {"_meta.slug": {"value": q, "boost": 10}}},
30+
{"match": {"info.title": {"query": q, "boost": 5.0}}},
2931
{"term": {"server.url": {"value": q, "boost": 1.1}}},
30-
{"term": {"_id": q}},
31-
{"wildcard": {"info.title": {"value": q + "*"}}},
32-
{"wildcard": {"info.description": {"value": q + "*"}}},
33-
{"query_string": {"query": q}},
32+
# ---------------------------------------------
33+
{"query_string": {"query": q}}, # base score
34+
# ---------------------------------------------
35+
{"wildcard": {"info.title": {"value": q + "*", "boost": 0.8}}},
36+
{"wildcard": {"info.description": {"value": q + "*", "boost": 0.5}}},
3437
]
3538
}
3639
}

0 commit comments

Comments
 (0)