Updating document quality

Blog

Updating document quality

  • 28 June, 2023
  • By Dave Cassel
  • No Comments
blog-image

A little-used Progress MarkLogic feature (from what I’ve seen) is the ability to change a document’s quality. Lowering this value will make it drop in search results, while increasing it will make it more prominent.

For one client, we’re allowing subject matter experts to lower the quality of documents that aren’t very helpful. They get a button that is hidden from regular users. Clicking the button sends a request to the middle tier, which in turn uses Progress MarkLogic’s REST API to change the quality of the target document. This can be accomplished with a PUT request to /v1/documents.

There was only one thing that threw us off for a moment: we thought we could handle this through the URL parameters, but with no message body, we got a 400 error. Here’s what to do instead, presented as a curl command:

curl --location 
  --request PUT \
  'http://localhost:8010/v1/documents?uri=/content/1234.json&category=quality' \
  --header 'Content-Type: application/json' \
  --data-raw '{ "quality": 10 }'

I’m leaving authentication as an exercise for the reader, but this shows specifying the needed information in the body. Hope that helps someone!

Share this post:

quote
A little-used Progress MarkLogic feature (from what I’ve seen) is the ability to change a document’s quality. Lowering this value...

4V Services works with development teams to boost their knowledge and capabilities. Contact us today to talk about how we can help you succeed!

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
cta-bg

Looking Forward to Building a Partnership!

Let's discuss how we can help your organization