This commit is contained in:
parent
9b2db3cc1d
commit
2e5919f3e6
|
@ -165,7 +165,15 @@ class SearchService:
|
|||
|
||||
async def search(self, text, limit, offset):
|
||||
logger.debug(f"Ищем: {text}")
|
||||
search_body = {"query": {"match": {"_all": text}}}
|
||||
search_body = {
|
||||
"query": {
|
||||
"multi_match": {
|
||||
"query": text,
|
||||
"fields": ["title", "lead", "subtitle", "body"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if self.client:
|
||||
search_response = self.client.search(index=self.index_name, body=search_body, size=limit, from_=offset)
|
||||
hits = search_response["hits"]["hits"]
|
||||
|
|
Loading…
Reference in New Issue
Block a user