mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-13 22:54:27 -04:00
Update archivebox/search/backends/ripgrep.py
Co-authored-by: Nick Sweeting <git@sweeting.me>
This commit is contained in:
parent
50df108863
commit
aa53f4f088
1 changed files with 1 additions and 3 deletions
|
@ -26,8 +26,7 @@ def flush(snapshot_ids: Generator[str, None, None]):
|
||||||
|
|
||||||
@enforce_types
|
@enforce_types
|
||||||
def search(text: str) -> List[str]:
|
def search(text: str) -> List[str]:
|
||||||
is_rg_installed = run(['which', RIPGREP_BINARY], stdout=DEVNULL, stderr=DEVNULL)
|
if not RIPGREP_VERSION:
|
||||||
if is_rg_installed.returncode:
|
|
||||||
raise Exception("ripgrep binary not found, install ripgrep to use this search backend")
|
raise Exception("ripgrep binary not found, install ripgrep to use this search backend")
|
||||||
|
|
||||||
from core.models import Snapshot
|
from core.models import Snapshot
|
||||||
|
@ -44,4 +43,3 @@ def search(text: str) -> List[str]:
|
||||||
snap_ids = [str(id) for id in Snapshot.objects.filter(timestamp__in=timestamps).values_list('pk', flat=True)]
|
snap_ids = [str(id) for id in Snapshot.objects.filter(timestamp__in=timestamps).values_list('pk', flat=True)]
|
||||||
|
|
||||||
return snap_ids
|
return snap_ids
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue