mirror of
https://github.com/alanorth/cgspace-notes.git
synced 2025-01-27 05:49:12 +01:00
Add notes for 2020-09-23
This commit is contained in:
@ -344,6 +344,8 @@ DELETE 12
|
||||
dspace=# COMMIT;
|
||||
```
|
||||
|
||||
- I added all CG center- and CRP-specific subject fields and mapped them to `dc.subject` in AReS
|
||||
- After forcing a re-harvesting now the review status is much cleaner and the missing subjects are available
|
||||
- Last week Natalia from CIAT had asked me to download all the PDFs for a certain query:
|
||||
- items with status "Open Access"
|
||||
- items with type "Journal Article"
|
||||
@ -351,4 +353,40 @@ dspace=# COMMIT;
|
||||
- The resulting OpenSearch query is: https://cgspace.cgiar.org/open-search/discover?query=type:"Journal Article" AND status:"Open Access" AND Water Land Ecosystems trade offs&rpp=1
|
||||
- There were 241 results with a total of 208 PDFs, which I downloaded with my `get-wle-pdfs.py` script and shared to her via bashupload.com
|
||||
|
||||
## 2020-09-23
|
||||
|
||||
- Peter said he was having problems submitting items to CGSpace
|
||||
- On a hunch I looked at the PostgreSQL locks in Munin and indeed the normal issue with locks is back (though I haven't seen it in a few months?)
|
||||
|
||||

|
||||
|
||||
- Instead of restarting Tomcat I restarted the PostgreSQL service and then Peter said he was able to submit the item...
|
||||
- Experiment with doing direct queries for items in the [dspace-statistics-api](https://github.com/ilri/dspace-statistics-api)
|
||||
- I tested querying a handful of item UUIDs with a date range and returning their hits faceted by `id`
|
||||
- Assuming a list of item UUIDs was posted to the REST API we could prepare them for a Solr query by joining them into a string with "OR" and escaping the hyphens:
|
||||
|
||||
```
|
||||
...
|
||||
item_ids = ['0079470a-87a1-4373-beb1-b16e3f0c4d81', '007a9df1-0871-4612-8b28-5335982198cb']
|
||||
item_ids_str = ' OR '.join(item_ids).replace('-', '\-')
|
||||
...
|
||||
solr_query_params = {
|
||||
"q": f"id:({item_ids_str})",
|
||||
"fq": "type:2 AND isBot:false AND statistics_type:view AND time:[2020-01-01T00:00:00Z TO 2020-09-02T00:00:00Z]",
|
||||
"facet": "true",
|
||||
"facet.field": "id",
|
||||
"facet.mincount": 1,
|
||||
"facet.limit": 1,
|
||||
"facet.offset": 0,
|
||||
"stats": "true",
|
||||
"stats.field": "id",
|
||||
"stats.calcdistinct": "true",
|
||||
"shards": shards,
|
||||
"rows": 0,
|
||||
"wt": "json",
|
||||
}
|
||||
```
|
||||
|
||||
- The date range format for Solr is important, but it seems we only need to add `T00:00:00Z` to the normal ISO 8601 YYYY-MM-DD strings
|
||||
|
||||
<!-- vim: set sw=2 ts=2: -->
|
||||
|
Reference in New Issue
Block a user