forked from mirrors/bookwyrm
Only include result blobs with results in search results
This commit is contained in:
parent
c005e458fa
commit
1844dd6b20
1 changed files with 8 additions and 7 deletions
|
@ -43,7 +43,7 @@ def search(query, min_confidence=0.1):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# if no isbn search or results, we fallback to generic search
|
# if no isbn search or results, we fallback to generic search
|
||||||
if result_set in (None, []):
|
if not result_set:
|
||||||
try:
|
try:
|
||||||
result_set = connector.search(query, min_confidence=min_confidence)
|
result_set = connector.search(query, min_confidence=min_confidence)
|
||||||
except Exception as e: # pylint: disable=broad-except
|
except Exception as e: # pylint: disable=broad-except
|
||||||
|
@ -51,12 +51,13 @@ def search(query, min_confidence=0.1):
|
||||||
logger.exception(e)
|
logger.exception(e)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
results.append(
|
if result_set or connector.local:
|
||||||
{
|
results.append(
|
||||||
"connector": connector,
|
{
|
||||||
"results": result_set,
|
"connector": connector,
|
||||||
}
|
"results": result_set,
|
||||||
)
|
}
|
||||||
|
)
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue