mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-24 03:36:55 -04:00
fix index SEARCH_BACKENDS import_backend to load via ABX instead of settings
Some checks are pending
CodeQL / Analyze (python) (push) Waiting to run
Build Debian package / build (push) Waiting to run
Build Docker image / buildx (push) Waiting to run
Build Homebrew package / build (push) Waiting to run
Build GitHub Pages website / build (push) Waiting to run
Build GitHub Pages website / deploy (push) Blocked by required conditions
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
Some checks are pending
CodeQL / Analyze (python) (push) Waiting to run
Build Debian package / build (push) Waiting to run
Build Docker image / buildx (push) Waiting to run
Build Homebrew package / build (push) Waiting to run
Build GitHub Pages website / build (push) Waiting to run
Build GitHub Pages website / deploy (push) Blocked by required conditions
Run linters / lint (push) Waiting to run
Build Pip package / build (push) Waiting to run
Run tests / python_tests (ubuntu-22.04, 3.11) (push) Waiting to run
Run tests / docker_tests (push) Waiting to run
This commit is contained in:
parent
dac134dfca
commit
5697ecefad
1 changed files with 5 additions and 5 deletions
|
@ -1,21 +1,21 @@
|
|||
__package__ = 'archivebox.search'
|
||||
|
||||
from typing import List, Union
|
||||
from pathlib import Path
|
||||
from typing import List, Union
|
||||
|
||||
from django.db.models import QuerySet
|
||||
from django.conf import settings
|
||||
|
||||
import abx.archivebox.use
|
||||
|
||||
from archivebox.index.schema import Link
|
||||
from archivebox.misc.util import enforce_types
|
||||
from archivebox.misc.logging import stderr
|
||||
from archivebox.config.legacy import ANSI
|
||||
|
||||
from archivebox.config import SEARCH_BACKEND_CONFIG
|
||||
|
||||
|
||||
def log_index_started(url):
|
||||
print('{green}[*] Indexing url: {} in the search index {reset}'.format(url, **ANSI))
|
||||
print('[green][*] Indexing url: {} in the search index[/]'.format(url))
|
||||
print( )
|
||||
|
||||
def get_file_result_content(res, extra_path, use_pwd=False):
|
||||
|
@ -57,7 +57,7 @@ def get_indexable_content(results: QuerySet):
|
|||
|
||||
|
||||
def import_backend():
|
||||
for backend in settings.SEARCH_BACKENDS.values():
|
||||
for backend in abx.archivebox.use.get_SEARCHBACKENDS().values():
|
||||
if backend.name == SEARCH_BACKEND_CONFIG.SEARCH_BACKEND_ENGINE:
|
||||
return backend
|
||||
raise Exception(f'Could not load {SEARCH_BACKEND_CONFIG.SEARCH_BACKEND_ENGINE} as search backend')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue