|
|
@ -54,10 +54,10 @@ class DefaultSearchContentsRepository @Inject constructor(
|
|
|
|
val newsResourceIds = newsResourceFtsDao.searchAllNewsResources("*$searchQuery*")
|
|
|
|
val newsResourceIds = newsResourceFtsDao.searchAllNewsResources("*$searchQuery*")
|
|
|
|
val topicIds = topicFtsDao.searchAllTopics("*$searchQuery*")
|
|
|
|
val topicIds = topicFtsDao.searchAllTopics("*$searchQuery*")
|
|
|
|
|
|
|
|
|
|
|
|
return combine(newsResourceIds, topicIds) { news, topics ->
|
|
|
|
return combine(newsResourceIds, topicIds) { newsFlow, topicsFlow ->
|
|
|
|
combine(
|
|
|
|
combine(
|
|
|
|
newsResourceDao.getNewsResources(filterNewsIds = news.toSet()),
|
|
|
|
newsResourceDao.getNewsResources(filterNewsIds = newsFlow.toSet()),
|
|
|
|
topicDao.getTopicEntities(topics.toSet()),
|
|
|
|
topicDao.getTopicEntities(topicsFlow.toSet()),
|
|
|
|
) { newsResources, topics ->
|
|
|
|
) { newsResources, topics ->
|
|
|
|
SearchResult(
|
|
|
|
SearchResult(
|
|
|
|
topics = topics.map { it.asExternalModel() },
|
|
|
|
topics = topics.map { it.asExternalModel() },
|
|
|
|