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
Checklist
I have read and understood the [Contribution Guidelines]().
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]().