version: v0.9.9
Description
I noticed a possible issue with free-text searches (?q=) when the dash (-) symbol is present after an initial word.
From here, I would expect the dash symbol to be translated into the & ! SQL operator, when coming not at the start of the string, only if preceded by a blank space. This sounds reasonable to me, as it would allow for searching dash-separated words, e.g. "first-generation", without it being interpreted as first & ! generation. What I observe, though, is that the - symbol is always interpreted as & !, regardless of the presence of blank spaces before it.
Possible solution
As far as I understand, this behaviour is controlled by this line
|
processed_text := regexp_replace(processed_text, '\s*\-([a-zA-Z0-9_]+)', ' & ! \1', 'g'); -- -term elsewhere |
A possible could be to replace it with
processed_text := regexp_replace(processed_text, '\s+\-([a-zA-Z0-9_]+)', ' & ! \1', 'g');
The same considerations apply to the + term.
version: v0.9.9
Description
I noticed a possible issue with free-text searches (
?q=) when the dash (-) symbol is present after an initial word.From here, I would expect the dash symbol to be translated into the
& !SQL operator, when coming not at the start of the string, only if preceded by a blank space. This sounds reasonable to me, as it would allow for searching dash-separated words, e.g. "first-generation", without it being interpreted asfirst & ! generation. What I observe, though, is that the-symbol is always interpreted as& !, regardless of the presence of blank spaces before it.Possible solution
As far as I understand, this behaviour is controlled by this line
pgstac/src/pgstac/sql/004_search.sql
Line 181 in df08f9b
A possible could be to replace it with
The same considerations apply to the
+term.