Update notes for 2019-01-21

This commit is contained in:
2019-01-21 14:16:56 +02:00
parent b90f4d3e45
commit 5f4d3668a2
3 changed files with 60 additions and 8 deletions

View File

@ -679,5 +679,30 @@ $ http 'http://localhost:3000/solr/statistics-2018/select?indent=on&rows=0&q=typ
- I opened an issue on the GitHub issue tracker ([#10](https://github.com/ilri/dspace-statistics-api/issues/10))
- I don't think the [SolrClient library](https://solrclient.readthedocs.io/en/latest/) we are currently using supports these type of queries so we might have to just do raw queries with requests
- The [pysolr](https://github.com/django-haystack/pysolr) library says it supports multicore indexes, but I am not sure it does (or at least not with our setup):
```
import pysolr
solr = pysolr.Solr('http://localhost:3000/solr/statistics')
results = solr.search('type:2', **{'fq': 'isBot:false AND statistics_type:view', 'facet': 'true', 'facet.field': 'id', 'facet.mincount': 1, 'facet.limit': 10, 'facet.offset': 0, 'rows': 0})
print(results.facets['facet_fields'])
{'id': ['77572', 646, '93185', 380, '92932', 375, '102499', 372, '101430', 337, '77632', 331, '102449', 289, '102485', 276, '100849', 270, '47080', 260]}
```
- If I double check one item from above, for example `77572`, it appears this is only working on the current statistics core and not the shards:
```
import pysolr
solr = pysolr.Solr('http://localhost:3000/solr/statistics')
results = solr.search('type:2 id:77572', **{'fq': 'isBot:false AND statistics_type:view'})
print(results.hits)
646
solr = pysolr.Solr('http://localhost:3000/solr/statistics-2018/')
results = solr.search('type:2 id:77572', **{'fq': 'isBot:false AND statistics_type:view'})
print(results.hits)
595
```
- So I guess I need to figure out how to use join queries and maybe even switch to using raw Python requests with JSON
<!-- vim: set sw=2 ts=2: -->