vespa-engine/vespa

synonyms in ruleset not working as expected

Opened this issue · 0 comments

synonyms/Replacements in ruleset file is not replacing text during query time.

To Reproduce
Steps to reproduce the behavior:
Ruleset file -

@default

#synonmys
bench saw -> table saw;
1st -> first;

Search query
select * from sources ecommerce.products where name contains "1st"

Indexed documents has field name with "first" as text

Expected behavior
Expected to replace "1st" with "first" at query time

Log messages -

          {
            "message": "   Evaluating rule '1st -> first' on 'name:1st' at '0:name:1st':"
          },
          {
            "message": "      '1st' does not match, label of 0:name:1st was required to be null"
          },
          {
            "message": "      Did not match '1st' at 0:name:1st"
          },
          {
            "message": "   Did not match rule '1st -> first' at 0:name:1st"
          },

Above is done using basic default vespa docker using latest version
Also tried adding below to ruleset. gives similar log error

[first] +> [first];
[first] :- 1st, first;

Log messages are not clear as why it is failing to replace text given in ruleset file.