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

Updating one or more tags across multiple documents at once #133

Closed
RyanBuhrWA opened this issue Jun 1, 2023 · 2 comments
Closed

Updating one or more tags across multiple documents at once #133

RyanBuhrWA opened this issue Jun 1, 2023 · 2 comments
Milestone

Comments

@RyanBuhrWA
Copy link

We have a need to be able to update one tag across multiple documents all at once. One method would be to allow sending a list of document IDs in the body of a POST or PATCH along with the tag info we'd want them all to have. A more convenient method would allow for sending other tag criteria by which to identify all the documents that need the new or updated tag(s).
Something like

{
    "getDocumentsByTag": {
        "key": "category",
        "value": 47
    },
    "newOrUpdatedTags": [{
        "key": "authorName",
        "value": "Doe, John"
    }]
}

would result in all documents that have the category tag with a value of 47 receiving a new tag called authorName with value "Doe, John", or if they already have the tag, its value would just be updated.

@mfriesen mfriesen added this to the v1.12.0 milestone Jul 24, 2023
@mfriesen
Copy link
Member

Adding new API

PATCH /documents/tags
{
"match":
{
"tag":
{
"key": "category",
"value": "47"
}
},
"update":
{
"tags":
[
{
"key": "authorName",
"value": "Doe, John"
}
]
}
}

@RyanBuhrWA
Copy link
Author

Awesome, thanks Mike!

mfriesen added a commit that referenced this issue Aug 14, 2023
* #130 - Feature: Added PUT/PATCH /documents/{documentId}/tags to allow adding/updating multiple tags to a document at once

* #131 - Feature: Added POST /documents/compress to create a ZIP file of multiple document's contents.

* #133 - Feature: Added PATCH /documents/tags to allow adding tags to documents based on tag search criteria

* #138 - Bug: Added validation for reservered tag keys when using POST /documents

* #144 - Bug: DELETE /indices/folder return 500 when invalid siteId is used

* #145 - Feature: Added Typesense support to API GET documents/{id}/fulltext

* #150 - Bug: Renamed module 'fulltext' to 'opensearch'

* #151 - Bug: Documentation for POST /documents/upload, missing contentLength

* #158 - Bug: Improved Actions API validation

* #159 - Feature: API Keys added READ / WRITE / DELETE permissions

* #161 - Bug: POST /documents/upload generates incorrect URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants