Use signal_tokenizer for search query

This commit is contained in:
Fedor Indutny 2023-12-04 18:38:40 +01:00 committed by GitHub
parent cc15d630a7
commit a81833d3ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 52 deletions

View file

@ -6,7 +6,6 @@ import { debounce, omit, reject } from 'lodash';
import type { ReadonlyDeep } from 'type-fest';
import type { StateType as RootStateType } from '../reducer';
import { cleanSearchTerm } from '../../util/cleanSearchTerm';
import { filterAndSortConversationsByRecent } from '../../util/filterAndSortConversations';
import type {
ClientSearchResultMessageType,
@ -294,21 +293,20 @@ async function queryMessages({
contactServiceIdsMatchingQuery?: Array<ServiceIdString>;
}): Promise<Array<ClientSearchResultMessageType>> {
try {
const normalized = cleanSearchTerm(query);
if (normalized.length === 0) {
if (query.length === 0) {
return [];
}
if (searchConversationId) {
return dataSearchMessages({
query: normalized,
query,
conversationId: searchConversationId,
contactServiceIdsMatchingQuery,
});
}
return dataSearchMessages({
query: normalized,
query,
contactServiceIdsMatchingQuery,
});
} catch (e) {