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

ISSUE-153: Solr driven entity autocomplete can not use match operator #154

Merged
merged 2 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/Element/WebformPanoramaTour.php
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,6 @@ public static function validatePanoramaTourElement(
// Means it was something inside the button
}
else {
error_log('Clear our redundant values');
$form_state->unsetValue([$element['#name'], 'scene']);
$form_state->unsetValue([$element['#name'], 'hotspots']);
$form_state->unsetValue([$element['#name'], 'hotspots_temp']);
Expand Down
6 changes: 6 additions & 0 deletions src/Plugin/EntityReferenceSelection/ViewsSolrSelection.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,12 @@ protected function initializeView(
$limit = 0,
$ids = NULL
) {
// @See https://github.com/esmero/webform_strawberryfield/issues/153
// May 2023, match_operator can not be used with Solr.
// We will keep it around to make the classes match but is unused
// When using Solr we will always get native match based on the Field
// type.

$view_name = $this->getConfiguration()['view']['view_name'];
$display_name = $this->getConfiguration()['view']['display_name'];

Expand Down
6 changes: 0 additions & 6 deletions src/Plugin/views/display/EntityReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,6 @@ public function query() {
// See if we need to use some escape mechanism from here
// @see \Drupal\search_api_solr\Utility\Utility
$value = $options['match_solr'];
if ($options['match_operator_solr'] !== '=') {
$value = $value . '%';
if ($options['match_operator_solr'] != 'STARTS_WITH') {
$value = '%' . $value;
}
}

// Multiple search fields are OR'd together.
$match_condition_group = $search_api_query->createConditionGroup('OR');
Expand Down