LP#1744385: Treat phrase terms the same as non-phrase terms WRT dictionaries
authorMike Rylander <mrylander@gmail.com>
Mon, 26 Feb 2018 17:05:37 +0000 (12:05 -0500)
committerDan Wells <dbw2@calvin.edu>
Wed, 28 Feb 2018 21:19:47 +0000 (16:19 -0500)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm

index bd223cb..b3e64eb 100644 (file)
@@ -1805,19 +1805,14 @@ sub buildSQL {
     $lang ||= $self->node->plan->QueryParser->default_preferred_language;
     my $ts_configs = [];
 
-    if (@{$self->node->phrases}) {
-        # We assume we want 'simple' for phrases. Gives us less to match against later.
-        $ts_configs = ['simple'];
+    if (!@$fields) {
+        $ts_configs = $self->node->plan->QueryParser->class_ts_config($classname, $lang);
     } else {
-        if (!@$fields) {
-            $ts_configs = $self->node->plan->QueryParser->class_ts_config($classname, $lang);
-        } else {
-            for my $field (@$fields) {
-                push @$ts_configs, @{$self->node->plan->QueryParser->field_ts_config($classname, $field, $lang)};
-            }
+        for my $field (@$fields) {
+            push @$ts_configs, @{$self->node->plan->QueryParser->field_ts_config($classname, $field, $lang)};
         }
-        $ts_configs = [keys %{{map { $_ => 1 } @$ts_configs}}];
     }
+    $ts_configs = [keys %{{map { $_ => 1 } @$ts_configs}}];
 
     # Assume we want exact if none otherwise provided.
     # Because we can reasonably expect this to exist