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

Simplify index synonyms syntax #330

Open
arkid15r opened this issue Jan 2, 2025 · 3 comments
Open

Simplify index synonyms syntax #330

arkid15r opened this issue Jan 2, 2025 · 3 comments
Assignees
Labels

Comments

@arkid15r
Copy link
Collaborator

arkid15r commented Jan 2, 2025

Is your feature request related to a problem? Please describe.
We have synonyms supports and currently they are in JSON format (ready to be consumed by Algolia index)

Describe the solution you'd like
Simplify file structure to support following (on issue synonyms example issues.json -> issues.txt:

mern: express, javascript, mongo, node, react, typescript // for one-way synonyms
js, javascript // regular synonyms

Update IndexBase::reindex_synonyms to efficiently parse .txt files with simplified structure and create synonyms structure for index.save_synonyms(synonyms, {"replaceExistingSynonyms": True})

@github-project-automation github-project-automation bot moved this to Backlog in Project Nest Jan 2, 2025
@arkid15r arkid15r moved this from Backlog to Todo in Project Nest Jan 2, 2025
@nitinawari
Copy link
Collaborator

Can i work on this ?

@arkid15r arkid15r moved this from Todo to In progress in Project Nest Jan 2, 2025
@nitinawari
Copy link
Collaborator

@arkid15r should i completely remove json reading or it must stay for backup
here is code sample
# Try reading .txt file first, fall back to .json if not found
file_paths = [
f"{settings.BASE_DIR}/apps/{app_name}/index/synonyms/{index_name}.txt",
f"{settings.BASE_DIR}/apps/{app_name}/index/synonyms/{index_name}.json"
]

@arkid15r
Copy link
Collaborator Author

arkid15r commented Jan 2, 2025

We'll use .txt files only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In progress
Development

No branches or pull requests

2 participants