Prefer minimum_should_match instead of and
This commit is contained in:
parent
e615962275
commit
f284ba1898
|
@ -147,7 +147,8 @@ const REQUESTS = {
|
|||
|
||||
const ELASTIC_SEARCH_QUERY = {
|
||||
FUZZINESS: 'AUTO:4,7',
|
||||
OPERATOR: 'AND',
|
||||
OPERATOR: 'OR',
|
||||
MINIMUM_SHOULD_MATCH: '75%',
|
||||
BOOST_LANGUAGE_VALUE: 1,
|
||||
MALUS_LANGUAGE_VALUE: 0.5,
|
||||
VIDEOS_MULTI_MATCH_FIELDS: buildMultiMatchFields(CONFIG.VIDEOS_SEARCH.SEARCH_FIELDS),
|
||||
|
|
|
@ -21,7 +21,8 @@ async function queryChannels (search: ChannelsSearchQuery) {
|
|||
query: search.search,
|
||||
fields: ELASTIC_SEARCH_QUERY.CHANNELS_MULTI_MATCH_FIELDS,
|
||||
fuzziness: ELASTIC_SEARCH_QUERY.FUZZINESS,
|
||||
operator: ELASTIC_SEARCH_QUERY.OPERATOR
|
||||
operator: ELASTIC_SEARCH_QUERY.OPERATOR,
|
||||
minimum_should_match: ELASTIC_SEARCH_QUERY.MINIMUM_SHOULD_MATCH
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -21,7 +21,8 @@ async function queryPlaylists (search: PlaylistsSearchQuery) {
|
|||
query: search.search,
|
||||
fields: ELASTIC_SEARCH_QUERY.PLAYLISTS_MULTI_MATCH_FIELDS,
|
||||
fuzziness: ELASTIC_SEARCH_QUERY.FUZZINESS,
|
||||
operator: ELASTIC_SEARCH_QUERY.OPERATOR
|
||||
operator: ELASTIC_SEARCH_QUERY.OPERATOR,
|
||||
minimum_should_match: ELASTIC_SEARCH_QUERY.MINIMUM_SHOULD_MATCH
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
@ -23,7 +23,8 @@ async function queryVideos (search: VideosSearchQuery) {
|
|||
query: search.search,
|
||||
fields: ELASTIC_SEARCH_QUERY.VIDEOS_MULTI_MATCH_FIELDS,
|
||||
fuzziness: ELASTIC_SEARCH_QUERY.FUZZINESS,
|
||||
operator: ELASTIC_SEARCH_QUERY.OPERATOR
|
||||
operator: ELASTIC_SEARCH_QUERY.OPERATOR,
|
||||
minimum_should_match: ELASTIC_SEARCH_QUERY.MINIMUM_SHOULD_MATCH
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue