_binary From 745b00cbf3650a5f215b1cea73665c373bb0fdc0 Mon Sep 17 00:00:00 2001
From: Gargi Sheguri <gargiegs@gmail.com>
Date: Mon, 13 Nov 2023 21:23:51 -0500
Subject: [PATCH] Disjunctive phrases fix: single term query

---
 src/models/PhraseModel.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/models/PhraseModel.php b/src/models/PhraseModel.php
index d7cb06de4..b7011fdd5 100755
--- a/src/models/PhraseModel.php
+++ b/src/models/PhraseModel.php
@@ -807,7 +807,7 @@ class PhraseModel extends ParallelModel
         if (isset($words) && count($words) == 1 &&
             count($disallow_phrases) < 1 && !strpos($words[0], " ")) {
             $phrase_string = $words[0];
-            $phrase_hash = $make_term_id($phrase_string);
+            $phrase_hash = $make_term_id(trim($phrase_string));
             $word_struct = ["KEYS" => [$phrase_hash],
                 "QUOTE_POSITIONS" => null, "DISALLOW_KEYS" => [],
                 "WEIGHT" => $weight, "INDEX_NAME" => $index_name,
-- 
2.42.0

