mirror of
https://github.com/simon987/sist2.git
synced 2025-12-14 07:49:06 +00:00
Rework user scripts, update DB schema to support embeddings
This commit is contained in:
@@ -41,8 +41,6 @@ class Sist2SearchBackend(BaseModel):
|
||||
es_insecure_ssl: bool = False
|
||||
es_index: str = "sist2"
|
||||
threads: int = 1
|
||||
script: str = ""
|
||||
script_file: str = None
|
||||
batch_size: int = 70
|
||||
|
||||
@staticmethod
|
||||
@@ -74,8 +72,6 @@ class IndexOptions(BaseModel):
|
||||
f"--es-index={search_backend.es_index}",
|
||||
f"--batch-size={search_backend.batch_size}"]
|
||||
|
||||
if search_backend.script_file:
|
||||
args.append(f"--script-file={search_backend.script_file}")
|
||||
if search_backend.es_insecure_ssl:
|
||||
args.append(f"--es-insecure-ssl")
|
||||
if self.incremental_index:
|
||||
@@ -249,13 +245,6 @@ class Sist2:
|
||||
|
||||
def index(self, options: IndexOptions, search_backend: Sist2SearchBackend, logs_cb):
|
||||
|
||||
if search_backend.script and search_backend.backend_type == SearchBackendType("elasticsearch"):
|
||||
with NamedTemporaryFile("w", prefix="sist2-admin", suffix=".painless", delete=False) as f:
|
||||
f.write(search_backend.script)
|
||||
search_backend.script_file = f.name
|
||||
else:
|
||||
search_backend.script_file = None
|
||||
|
||||
args = [
|
||||
self.bin_path,
|
||||
*options.args(search_backend),
|
||||
|
||||
Reference in New Issue
Block a user