Open njlyon0 opened 7 months ago
I just heard about the query
function in the dataone
package which seems like it could be a nice 'middle path' for constructing Solr queries (see here).
Users can create their own Solr queries (A) by hand/manually, (B) by supplying a named list that breaks queries into four chunks, or (C) by using something like the function I supplied above where each Solr parameter is mapped to a separate argument.
I'm biased but I think the mapping of each parameter to its own argument is novel enough (relative to dataone::query
) that it still warrants inclusion as its own function but I wanted to point out that a similar function does already exist
This is great @njlyon0, thanks for the draft! I'll give it a test drive and return with some feedback.
Related to #36
Summary
Hey
EDIutils
team! I had a conversation with Colin Smith and Greg Maurer recently about creating amake_query
function to help make Solr queries for people with some R literacy but limited prior exposure to Solr. The hope is that this new function would make it easier for R users to make good use ofEDIutils::search_data_packages
.I've taken a stab at this function and will attach the full code to this issue. Note that I also wrote two helper functions
solr_wild
andsolrize
to make the internal components ofmake_query
as streamlined as possible. I'm definitely a novice to Solr queries somake_query
may be missing crucial arguments but I think it's a reasonable starting point and is built to be semi-modular and could easily support additional arguments. All functions are written in base R (version 4.3.2).Let me know if this doesn't work on your end and/or if you'd like me to make any changes before it could possibly be built into
EDIutils
. Thanks!Function Demo Script