mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-04 11:41:04 +02:00
DAN-118 Jira connector (#102)
* Small confluence page QoL changes * Prevent getting into a bad state with orphan connectors for Jira / Confluence * Jira connector + admin page --------- Co-authored-by: Weves <chrisweaver101@gmail.com>
This commit is contained in:
27
backend/scripts/list_typesense_docs.py
Normal file
27
backend/scripts/list_typesense_docs.py
Normal file
@ -0,0 +1,27 @@
|
||||
from danswer.configs.app_configs import TYPESENSE_DEFAULT_COLLECTION
|
||||
from danswer.utils.clients import get_typesense_client
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
ts_client = get_typesense_client()
|
||||
|
||||
page_number = 1
|
||||
per_page = 100 # number of documents to retrieve per page
|
||||
while True:
|
||||
params = {
|
||||
"q": "",
|
||||
"query_by": "content",
|
||||
"page": page_number,
|
||||
"per_page": per_page,
|
||||
}
|
||||
response = ts_client.collections[TYPESENSE_DEFAULT_COLLECTION].documents.search(
|
||||
params
|
||||
)
|
||||
documents = response.get("hits")
|
||||
if not documents:
|
||||
break # if there are no more documents, break out of the loop
|
||||
|
||||
for document in documents:
|
||||
print(document)
|
||||
|
||||
page_number += 1 # move on to the next page
|
@ -27,6 +27,11 @@ def wipe_all_rows(database: str) -> None:
|
||||
|
||||
table_names = cur.fetchall()
|
||||
|
||||
# have to delete from these first to not run into psycopg2.errors.ForeignKeyViolation
|
||||
cur.execute(f"DELETE FROM connector_credential_pair")
|
||||
cur.execute(f"DELETE FROM index_attempt")
|
||||
conn.commit()
|
||||
|
||||
for table_name in table_names:
|
||||
if table_name[0] == "alembic_version":
|
||||
continue
|
||||
|
Reference in New Issue
Block a user