Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard-coded SOLR field names #52

Open
bradspry opened this issue Mar 15, 2018 · 3 comments
Open

Hard-coded SOLR field names #52

bradspry opened this issue Mar 15, 2018 · 3 comments

Comments

@bradspry
Copy link

The following lines have hardcoded SOLR field names:

// Build the Solr query.
$query = '';
$query_parts = array();
if (drush_get_option('is_member_of')) {
$query_parts[] = 'RELS_EXT_isMemberOf_uri_t' . ':"' . drush_get_option('is_member_of') . '"';
}
if (drush_get_option('collection')) {
$query_parts[] = 'RELS_EXT_isMemberOfCollection_uri_t' . ':"' . drush_get_option('collection') . '"';
}
if (drush_get_option('content_model')) {
$query_parts[] = 'RELS_EXT_hasModel_uri_t' . ':' . '"info:fedora/' . drush_get_option('content_model') . '"';
}

My SOLR indexer uses suffix '_mt' for tokenized fields.

Hacking the source isn't the best option, but that's what I had to do to get --collection, --is_member_of, and --content_model options up and running for us.

Strangely enough, the --with_dsid and --without_dsid options utilize the '_mt' suffix.

if (drush_get_option('with_dsid')) {
// Other options are present.
if (strlen($query)) {
$query .= ' AND fedora_datastreams_mt:' . drush_get_option('with_dsid');
}
else {
// Only option is --with_dsid.
$query = 'fedora_datastreams_mt:' . drush_get_option('with_dsid');
}
}
if (drush_get_option('without_dsid')) {
// Other options are present.
if (strlen($query)) {
$query .= ' AND -fedora_datastreams_mt:' . drush_get_option('without_dsid');
}
else {
// Only option is --without_dsid.
$query = '-fedora_datastreams_mt:' . drush_get_option('without_dsid');
}
}

Just reporting the issue, I have no suggestions for addressing it. 🐳

@mjordan
Copy link
Collaborator

mjordan commented Mar 15, 2018

Our friend @DiegoPino opened #10 many moons ago... not sure if he's still interested, but if not, we can probably come up with a command-line solution to the mapping problem.

@mjordan
Copy link
Collaborator

mjordan commented Mar 15, 2018

Command line or a little config file.

@bradspry
Copy link
Author

Sorry for the dupe! I just didn't see it... 🙈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants