This commit is contained in:
parent
aa1693cc16
commit
df15e63dde
|
@ -131,9 +131,11 @@ class SearchService:
|
||||||
if self.client:
|
if self.client:
|
||||||
id_ = str(shout.id)
|
id_ = str(shout.id)
|
||||||
logger.debug(f' Индексируем пост {id_}')
|
logger.debug(f' Индексируем пост {id_}')
|
||||||
asyncio.create_task(
|
asyncio.create_task(self.perform_index(shout))
|
||||||
self.client.index(index=self.index_name, id=id_, body=shout.dict())
|
|
||||||
)
|
async def perform_index(self, shout):
|
||||||
|
if self.client:
|
||||||
|
await self.client.index(index=self.index_name, id=str(shout.id), body=shout.dict())
|
||||||
|
|
||||||
async def search(self, text, limit, offset):
|
async def search(self, text, limit, offset):
|
||||||
logger.debug(f' Ищем: {text}')
|
logger.debug(f' Ищем: {text}')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user