improve search result relevance
This commit is contained in:
parent
76ebf50c40
commit
80c1462866
|
@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
### Changed
|
||||
|
||||
- Performance improvements when opening the app on something that isn't the graph.
|
||||
- There are now fewer irrelevant search results.
|
||||
|
||||
### Deprecated
|
||||
|
||||
|
|
|
@ -115,6 +115,7 @@ defmodule Backend.Api do
|
|||
"sort" => "_score",
|
||||
"from" => from,
|
||||
"size" => page_size,
|
||||
"min_score" => 1,
|
||||
"query" => %{
|
||||
"bool" => %{
|
||||
"filter" => %{
|
||||
|
@ -127,7 +128,8 @@ defmodule Backend.Api do
|
|||
"multi_match" => %{
|
||||
"query" => query,
|
||||
"fields" => [
|
||||
"description.english"
|
||||
"description.english",
|
||||
"domain.english"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -143,14 +145,9 @@ defmodule Backend.Api do
|
|||
"wildcard" => %{
|
||||
"domain.keyword" => %{
|
||||
"value" => "*#{query}*",
|
||||
"boost" => 1
|
||||
"boost" => 50
|
||||
}
|
||||
}
|
||||
},
|
||||
%{
|
||||
"match" => %{
|
||||
"domain.ngram^0.5" => query
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -1,21 +1,7 @@
|
|||
{
|
||||
"settings": {
|
||||
"number_of_shards": 1,
|
||||
"number_of_replicas": 0,
|
||||
"analysis": {
|
||||
"analyzer": {
|
||||
"ngramAnalyzer": {
|
||||
"tokenizer": "ngramTokenizer"
|
||||
}
|
||||
},
|
||||
"tokenizer": {
|
||||
"ngramTokenizer": {
|
||||
"type": "ngram",
|
||||
"min_gram": 5,
|
||||
"max_gram": 5
|
||||
}
|
||||
}
|
||||
}
|
||||
"number_of_replicas": 0
|
||||
},
|
||||
"mappings": {
|
||||
"_doc": {
|
||||
|
@ -23,12 +9,12 @@
|
|||
"domain": {
|
||||
"type": "text",
|
||||
"fields": {
|
||||
"ngram": {
|
||||
"type": "text",
|
||||
"analyzer": "ngramAnalyzer"
|
||||
},
|
||||
"keyword": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"english": {
|
||||
"type": "text",
|
||||
"analyzer": "english"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue