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

Modified the Index Document Method to Always Perform Hard Reindex #303

Merged
merged 3 commits into from
May 2, 2024

Conversation

tahierhussain
Copy link
Contributor

What

In the current implementation, when the user clicks on the reindex button in the document manager modal, the method to index will be triggered. In that method, we check if the doc_id is already present. If it is, we simply skip the indexing part and return with a success message. However, we need to change that behavior to allow the user to delete the existing doc_id and create a new one when clicking on the reindex button.

Why

There are cases where the user would want to perform a hard reindex, meaning they want to delete the existing doc_id and create a new one. To accommodate this, we've made the necessary changes.

How

We already have a parameter passed to the index_document function called reindex, which is False by default. The reindex parameter is set to True whenever the user manually tries to reindex.

Can this PR break any existing features. If yes please list of possible items. If no please exaplin why. (PS: Admins do not merge the PR without this section filled)

This PR will not break any existing features. The main changes are made only inside the PromptStudioHelper.index_document method, which will be called only when the user manually tries to reindex.

Database Migrations

NA

Env Config

NA

Relevant Docs

NA

Related Issues or PRs

NA

Dependencies Versions

NA

Notes on Testing

NA

Screenshots

image

Checklist

I have read and understood the Contribution Guidelines.

Copy link

sonarqubecloud bot commented May 2, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@nehabagdia nehabagdia merged commit 62dedc6 into main May 2, 2024
4 checks passed
@nehabagdia nehabagdia deleted the fix/hard-reindex branch May 2, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants