Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish search API, frontend and backend #28

Merged
merged 30 commits into from
Oct 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix index init
rbs333 committed Jul 19, 2024
commit 328624fb87647a487d96d7d98a0de7513ef4d96a
8 changes: 7 additions & 1 deletion backend/arxivsearch/db/redis_helpers.py
Original file line number Diff line number Diff line change
@@ -25,7 +25,13 @@ def get_schema():

def get_index():
rbs333 marked this conversation as resolved.
Show resolved Hide resolved
dir_path = os.path.dirname(os.path.realpath(__file__))
return SearchIndex.from_yaml(os.path.join(dir_path, "index.yaml"))
index = SearchIndex.from_yaml(os.path.join(dir_path, "index.yaml"))
index.connect(redis_url=config.REDIS_URL)

if index.exists():
return index
else:
index.create(overwrite=True)


async def get_async_index():
1 change: 0 additions & 1 deletion backend/arxivsearch/tests/utils/seed.py
Original file line number Diff line number Diff line change
@@ -21,6 +21,5 @@ def seed_test_db():
paper["cohere"] = np.array(paper["cohere"], dtype=np.float32).tobytes()

index = redis_helpers.get_index()
index.connect(redis_url=config.REDIS_URL)
index.load(data=papers, id_field="paper_id")
return papers