Prefer minimum_should_match instead of and

This commit is contained in:
Chocobozzz 2021-11-24 10:15:16 +01:00
parent e615962275
commit f284ba1898
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
4 changed files with 8 additions and 4 deletions

View File

@ -147,7 +147,8 @@ const REQUESTS = {
const ELASTIC_SEARCH_QUERY = { const ELASTIC_SEARCH_QUERY = {
FUZZINESS: 'AUTO:4,7', FUZZINESS: 'AUTO:4,7',
OPERATOR: 'AND', OPERATOR: 'OR',
MINIMUM_SHOULD_MATCH: '75%',
BOOST_LANGUAGE_VALUE: 1, BOOST_LANGUAGE_VALUE: 1,
MALUS_LANGUAGE_VALUE: 0.5, MALUS_LANGUAGE_VALUE: 0.5,
VIDEOS_MULTI_MATCH_FIELDS: buildMultiMatchFields(CONFIG.VIDEOS_SEARCH.SEARCH_FIELDS), VIDEOS_MULTI_MATCH_FIELDS: buildMultiMatchFields(CONFIG.VIDEOS_SEARCH.SEARCH_FIELDS),

View File

@ -21,7 +21,8 @@ async function queryChannels (search: ChannelsSearchQuery) {
query: search.search, query: search.search,
fields: ELASTIC_SEARCH_QUERY.CHANNELS_MULTI_MATCH_FIELDS, fields: ELASTIC_SEARCH_QUERY.CHANNELS_MULTI_MATCH_FIELDS,
fuzziness: ELASTIC_SEARCH_QUERY.FUZZINESS, fuzziness: ELASTIC_SEARCH_QUERY.FUZZINESS,
operator: ELASTIC_SEARCH_QUERY.OPERATOR operator: ELASTIC_SEARCH_QUERY.OPERATOR,
minimum_should_match: ELASTIC_SEARCH_QUERY.MINIMUM_SHOULD_MATCH
} }
} }
] ]

View File

@ -21,7 +21,8 @@ async function queryPlaylists (search: PlaylistsSearchQuery) {
query: search.search, query: search.search,
fields: ELASTIC_SEARCH_QUERY.PLAYLISTS_MULTI_MATCH_FIELDS, fields: ELASTIC_SEARCH_QUERY.PLAYLISTS_MULTI_MATCH_FIELDS,
fuzziness: ELASTIC_SEARCH_QUERY.FUZZINESS, fuzziness: ELASTIC_SEARCH_QUERY.FUZZINESS,
operator: ELASTIC_SEARCH_QUERY.OPERATOR operator: ELASTIC_SEARCH_QUERY.OPERATOR,
minimum_should_match: ELASTIC_SEARCH_QUERY.MINIMUM_SHOULD_MATCH
} }
} }
] ]

View File

@ -23,7 +23,8 @@ async function queryVideos (search: VideosSearchQuery) {
query: search.search, query: search.search,
fields: ELASTIC_SEARCH_QUERY.VIDEOS_MULTI_MATCH_FIELDS, fields: ELASTIC_SEARCH_QUERY.VIDEOS_MULTI_MATCH_FIELDS,
fuzziness: ELASTIC_SEARCH_QUERY.FUZZINESS, fuzziness: ELASTIC_SEARCH_QUERY.FUZZINESS,
operator: ELASTIC_SEARCH_QUERY.OPERATOR operator: ELASTIC_SEARCH_QUERY.OPERATOR,
minimum_should_match: ELASTIC_SEARCH_QUERY.MINIMUM_SHOULD_MATCH
} }
} }
] ]