Inconsistency while deleting resources using API

18 views
Skip to first unread message

viraj.par...@edmodo.com

unread,
Feb 10, 2017, 8:18:47 AM2/10/17
to Learning Registry Developers List
Hello,

Quick note before I begin - all operations below are being done on node01.

In continuation of a conversation about wrong resource locators, we used the update mechanism (described in the 20-minute guideto try and update the resources with the right details. But, it seems they couldn't get updated correctly and we ended up with URLs in place of names. If I search with the keyword 'edmodo' in the search widget on the LR home page, the problem is immediately seen. This was a problem in itself, but we found a workaround.

We realized we could see the correct results if we uploaded a fresh new resource. So, we decided to delete all uploaded resources from LR and re-upload the resources with the correct info. Now, when we deleted the resources using API (again, as described in the guide), we got a simple OK response ({"document_results": [{"OK": false, "error": ""}], "OK": true}). I can also verify that the resources are deleted by simply fetching all resources under our account using the API (via EasyPublish + Chrome Dev Tools) and I get an empty array.

However, when I use the publisher filter (Publisher name: Edmodo Spotlight, Email: viraj.par...@edmodo.com) in the search widget or search by keyword 'Edmodo', I can still see all these (63) resources returned.

Can anyone please confirm why this is happening and what could be the way out? We can re-upload the resources once we're sure the earlier resource instances are completely cleaned up.

Thanks in advance,

Best regards,
Viraj

joe hobson

unread,
Feb 10, 2017, 6:13:07 PM2/10/17
to learnin...@googlegroups.com
Viraj,

I'm sorry you're having trouble with the delete functions, and I hope I can help you get it sorted out. 

First off, it's important to understand that the search service is separate from the LR nodes, so it's not always an accurate way of determining what records are in the LR. It's an index, it's not real-time data. The easiest way to filter an LR node for specific records is to use slice.


It looks like you have successfully deleted and/or replaced many records on the node. From what I can tell, there are 15 remaining records under that ID. 

As for the search service index, it doesn't automatically refresh and remove existing records after they have been indexed, which is why you were still seeing 63 resources returned there. We discussed this last fall on the LR Dev group (Search index refresh interval?). I've gone through and manually removed most of your records from the index to clear out the old/test data where possible. If you clear out more records and want me to make sure they get flushed from the search index, just send me a list of the doc IDs.

Lastly, you may have run into problems using EasyPublish with the "Sync from Learning Registry" button. It looks like there may be an error with that function. I'll investigate early next week and post a message to the group when it's fixed.

Hope that helps. ... .joe


--
You received this message because you are subscribed to the Google Groups "Learning Registry Developers List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to learningreg-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

viraj.par...@edmodo.com

unread,
Feb 13, 2017, 6:26:29 AM2/13/17
to Learning Registry Developers List
Hi Joe,

Thanks for the quick response and getting rid of the products from the index for us. I will take care of the remaining products and send you a list of the further ones we want to remove from the index (after removing them from the node).

Thanks also for pointing to the slice API. It does show all the products still there, but most are deleted.

Lastly, we only saw one problem with the "Sync from Learning Registry" button - specifically when I click it, it refuses to load any products in the EasyPublish UI, even with the most open filters. So, my workaround was to look at the request and response in dev tools. However, now since clicking the button gets an empty array in the response (which I expect, because all products from my account are deleted), this would be expected behavior. My problem was more about the earlier behavior when we were seeing an array returned, but none (or maybe very few of the entries) showed up in the UI.

I'll let you know the deleted product IDs.

Best regards,
Viraj

On Saturday, February 11, 2017 at 4:43:07 AM UTC+5:30, joe hobson wrote:
Viraj,

I'm sorry you're having trouble with the delete functions, and I hope I can help you get it sorted out. 

First off, it's important to understand that the search service is separate from the LR nodes, so it's not always an accurate way of determining what records are in the LR. It's an index, it's not real-time data. The easiest way to filter an LR node for specific records is to use slice.

Reply all
Reply to author
Forward
0 new messages