private Mono<List<User>> search(
            @Nullable Integer skip,
            @Nullable Integer limit,
            @Nullable Set<Long> userIds,
            @NotNull String name,
            @Nullable List<Integer> fieldsToHighlight) {
        if (!elasticsearchManager.isUserUseCaseEnabled()) {
            return Mono.error(ResponseException.get(ResponseStatusCode.SEARCHING_USER_IS_DISABLED));
        }
        boolean highlight = CollectionUtil.isNotEmpty(fieldsToHighlight);
        return elasticsearchManager
                .searchUserDocs(skip, limit, name, userIds, highlight, null, null)
                .flatMap(response -> {
                    List<Hit<UserDoc>> hits = response.hits()
                            .hits();
                    int count = hits.size();
                    if (count == 0) {
                        return PublisherPool.emptyList();
                    }
                    if (highlight) {
                        Map<Long, String> userIdToHighlightedName =
                                CollectionUtil.newMapWithExpectedSize(count);
                        List<Long> ids = new ArrayList<>(count);
                        for (Hit<UserDoc> hit : hits) {
                            Long id = Long.parseLong(hit.id());
                            Collection<List<String>> highlightValues = hit.highlight()
                                    .values();
                            if (!highlightValues.isEmpty()) {
                                List<String> values = highlightValues.iterator()
                                        .next();
                                if (!values.isEmpty()) {
                                    userIdToHighlightedName.put(id, values.getFirst());
                                }
                            }
                            ids.add(id);
                        }
                        Mono<List<User>> mono = userRepository
                                .findNotDeletedUserProfiles(ids,
                                        userInfoUserDefinedAttributesService.knownAttributes,
                                        null)
                                .collect(CollectorUtil.toList(count));
                        return mono.map(users -> {
                            if (users.isEmpty()) {
                                return Collections.emptyList();
                            }
                            Map<Long, User> userIdToUser =
                                    CollectionUtil.newMapWithExpectedSize(users.size());
                            for (User user : users) {
                                userIdToUser.put(user.getId(), user);
                            }
                            for (Map.Entry<Long, String> entry : userIdToHighlightedName
                                    .entrySet()) {
                                User user = userIdToUser.get(entry.getKey());
                                if (user != null) {
                                    user.setName(entry.getValue());
                                }
                            }
                            return users;
                        });
                    } else {
                        List<Long> ids = new ArrayList<>(count);
                        for (Hit<UserDoc> hit : hits) {
                            ids.add(Long.parseLong(hit.id()));
                        }
                        return userRepository
                                .findNotDeletedUserProfiles(ids,
                                        userInfoUserDefinedAttributesService.knownAttributes,
                                        null)
                                .collect(CollectorUtil.toList(count));
                    }
                });
    }
@return Possible codes: {@link ResponseStatusCode#OK}
        {@link ResponseStatusCode#NOT_FRIEND_TO_QUERY_USER_PROFILE}
        {@link ResponseStatusCode#BLOCKED_USER_TO_QUERY_USER_PROFILE}
        {@link ResponseStatusCode#SERVER_INTERNAL_ERROR}
        {@link ResponseStatusCode#RESOURCE_NOT_FOUND}
turms-service/src/main/java/im/turms/service/domain/user/service/UserService.java