server/posts: ignore old elasticsearch results
This commit is contained in:
parent
49feb932f3
commit
7044d2aaee
1 changed files with 6 additions and 4 deletions
|
@ -682,10 +682,12 @@ def search_by_image_exact(image_content: bytes) -> Optional[model.Post]:
|
||||||
def search_by_image(image_content: bytes) -> List[PostLookalike]:
|
def search_by_image(image_content: bytes) -> List[PostLookalike]:
|
||||||
ret = []
|
ret = []
|
||||||
for result in image_hash.search_by_image(image_content):
|
for result in image_hash.search_by_image(image_content):
|
||||||
ret.append(PostLookalike(
|
post = try_get_post_by_id(result.path)
|
||||||
score=result.score,
|
if post:
|
||||||
distance=result.distance,
|
ret.append(PostLookalike(
|
||||||
post=get_post_by_id(result.path)))
|
score=result.score,
|
||||||
|
distance=result.distance,
|
||||||
|
post=post))
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue