Skip to content

Commit

Permalink
Remove add-copy-field function.
Browse files Browse the repository at this point in the history
  • Loading branch information
melaniekung committed May 31, 2024
1 parent a7d83bc commit b484d3d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions plugins/arSolrPlugin/lib/arSolrPlugin.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,10 @@ protected function initialize()
arSolrPlugin::makeHttpRequest($url);

$addFieldQuery = '';
$addCopyFieldQuery = '';

// Add fields to 'all' field
$q = $this->getFieldQuery('all', 'text_general', true, false, false);
$addFieldQuery .= $q[0];
$addCopyFieldQuery .= $q[1];

$url = $this->solrBaseUrl.'/api/collections/'.$this->solrClientOptions['collection'].'/config/';
$updateDefaultHandler = '{"update-requesthandler": {"name": "/select", "class": "solr.SearchHandler", "defaults": {"df": "all", "echoParams": "explicit"}}}';
Expand All @@ -362,13 +360,11 @@ protected function initialize()
if (null != $value['type'] && 'nested' !== $value['type'] && 'object' !== $value['type']) {
$q = $this->getFieldQuery($key, $this->setType($value['type']), false, $includeInCopy);
$addFieldQuery .= $q[0];
$addCopyFieldQuery .= $q[1];
} else {
if (null === $value['type']) {
// array fields
$q = $this->getFieldQuery($key, '_nest_path_', true);
$addFieldQuery .= $q[0];
$addCopyFieldQuery .= $q[1];
$this->addNestedFields($key, $value['properties']);
} else {
// object and nested fields
Expand All @@ -379,13 +375,11 @@ protected function initialize()
$fields .= '"'.$k.':/'.$key.'/'.$k.'",';
$q = $this->getFieldQuery($k, $this->setType($v['type']), false, $includeInCopy);
$addFieldQuery .= $q[0];
$addCopyFieldQuery .= $q[1];
}
} elseif (null != $value['type']) {
$fields .= '"'.$key.':/'.$key.'",';
$q = $this->getFieldQuery($key, $this->setType($value['type']), false, $includeInCopy);
$addFieldQuery .= $q[0];
$addCopyFieldQuery .= $q[1];
}
}
$fields = rtrim($fields, ',').']';
Expand All @@ -396,8 +390,7 @@ protected function initialize()
}

$addFieldQuery = rtrim($addFieldQuery, ',');
$addCopyFieldQuery = rtrim($addCopyFieldQuery, ',');
$addQuery = '{"add-field":['.$addFieldQuery.'],"add-copy-field":['.$addCopyFieldQuery.']}';
$addQuery = '{"add-field":['.$addFieldQuery.']}';

$this->addFieldsToType($addQuery);
}
Expand Down

0 comments on commit b484d3d

Please sign in to comment.