NCEAS / datateam-training

Training and reference materials for ADC and SASAP data team members
https://nceas.github.io/datateam-training/training/
Apache License 2.0
7 stars 22 forks source link

Update Solr query section on backslashes #245

Open laijasmine opened 3 years ago

laijasmine commented 3 years ago

In the example Solr queries here: https://nceas.github.io/datateam-training/reference/example-solr-queries.html

shows only this so that it can be interpreted literally:

dataone::query(adc, list(q = paste0('id:', '\"', 'doi:10.18739/A20R9M36V', '\"'),
                         fl = 'dateUploaded AND identifier',
                         rows = 5000),
               as = "data.frame")

can also be:

dataone::query(adc, list(q = 'id:doi\\:10.18739/A20R9M36V',
                         fl = 'dateUploaded AND identifier',
                         rows = 5000),
               as = "data.frame")

add further clarification in this section that because : is a special character that it needs to be escaped using a slash.

amoeba commented 3 years ago

Good idea here. I'm not sure which is easier for learners but FWIW I use id:"doi:10.124/ABC"' to avoid having to escape anything (wrapping in double quotes).