Modified the Index Document Method to Always Perform Hard Reindex #303
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 thedoc_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 existingdoc_id
and create a new one when clicking on thereindex
button.Why
There are cases where the user would want to perform a hard
reindex
, meaning they want to delete the existingdoc_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 calledreindex
, which isFalse
by default. Thereindex
parameter is set toTrue
whenever the user manually tries toreindex
.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
Checklist
I have read and understood the Contribution Guidelines.