mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 21:29:13 +00:00
Put image score breakdown under `additional' field in search response
- Update web, emacs interfaces to consume the scores from new schema
This commit is contained in:
@@ -220,12 +220,17 @@ def collate_results(hits, image_names, output_directory, image_files_url, count=
|
||||
shutil.copy(source_path, target_path)
|
||||
|
||||
# Add the image metadata to the results
|
||||
results += [{
|
||||
"entry": f'{image_files_url}/{target_image_name}',
|
||||
"score": f"{hit['score']:.9f}",
|
||||
"image_score": f"{hit['image_score']:.9f}",
|
||||
"metadata_score": f"{hit['metadata_score']:.9f}",
|
||||
}]
|
||||
results += [
|
||||
{
|
||||
"entry": f'{image_files_url}/{target_image_name}',
|
||||
"score": f"{hit['score']:.9f}",
|
||||
"additional":
|
||||
{
|
||||
"image_score": f"{hit['image_score']:.9f}",
|
||||
"metadata_score": f"{hit['metadata_score']:.9f}",
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
return results
|
||||
|
||||
|
||||
Reference in New Issue
Block a user