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

"<*" and ">*" don't work when we don't use "query()" in the right side of them #1218

Open
komainu8 opened this issue Jun 26, 2021 · 0 comments · May be fixed by #1262
Open

"<*" and ">*" don't work when we don't use "query()" in the right side of them #1218

komainu8 opened this issue Jun 26, 2021 · 0 comments · May be fixed by #1262

Comments

@komainu8
Copy link
Member

If we specify 'content @ "Groonga" *<2.5 content @ "Mroonga"' in filter condition, the scores of matched records don't adjust.

The score of {"content": "Mroonga is a MySQL storage engine based of Groonga."} should be -1.5, but it is 2.0 in the followning example.

       table_create Memos TABLE_NO_KEY
       column_create Memos content COLUMN_SCALAR ShortText

       table_create Terms TABLE_PAT_KEY ShortText \
         --default_tokenizer TokenBigram \
         --normalizer NormalizerAuto
       column_create Terms index COLUMN_INDEX|WITH_POSITION Memos content

       load --table Memos
       [
       {"content": "Groonga is a full text search engine."},
       {"content": "Rroonga is the Ruby bindings of Groonga."},
       {"content": "Mroonga is a MySQL storage engine based of Groonga."}
       ]

        select Memos \
          --command_version 3 \
          --filter 'content @ "Groonga" *<2.5 content @ "Mroonga"' \
          --output_columns 'content, _score' \
          --sort_keys -_score,_id

{"header":{"return_code":0,"start_time":1624609198.982172,"elapsed_time":0.027374267578125},"body":{"n_hits":1,"columns":[{"name":"content","type":"ShortText"},{"name":"_score","type":"Float"}],"orecords":[["Mroonga is a MySQL storage engine based of Groonga.",2.0]]}}

We should also adjust the scores of matched records when we specify 'content @ "Groonga" *<2.5 content @ "Mroonga"' not only when 'content @ "Groonga" *<2.5 query("content", "Mroonga")'

@komainu8 komainu8 linked a pull request Sep 2, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant