Zipstack / unstract

No-code LLM Platform to launch APIs and ETL Pipelines to structure unstructured documents
https://unstract.com
GNU Affero General Public License v3.0
882 stars 54 forks source link

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

Closed tahierhussain closed 3 months ago

tahierhussain commented 3 months ago

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]().

sonarcloud[bot] commented 3 months ago

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