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

Can't fulltext search against reference column of vector #1780

Merged
merged 6 commits into from
May 21, 2024

Conversation

komainu8
Copy link
Member

@komainu8 komainu8 commented May 15, 2024

Fix mroonga/mroonga#674.

What happend?

Groonga always returns that the number of hits is 0 when we execute full-text search against reference column of vector as below. Note that a lexicon (tags in this case) must have a tokenizer.

table_create bugs TABLE_PAT_KEY UInt32

table_create tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit
column_create tags name COLUMN_SCALAR ShortText

column_create bugs tags COLUMN_VECTOR tags

load --table bugs
[
["_key", "tags"],
[1, "Linux MySQL"],
[2, "MySQL Groonga"],
[3, "Mroonga"]
]

column_create tags bugs_tags_index COLUMN_INDEX bugs tags

select --table bugs --filter 'tags @ "MySQL"'
[[0,0.0,0.0],[[[0],[["_id","UInt32"],["_key","UInt32"],["tags","tags"]]]]]

Solution

In this PR, If the source of index was reference column, Groonga get key_type from a table that the reference column refer.

This problem occurs from 535844b.
If the source of index was reference column, Groonga couldn't get key and key_type correctly in the above modification.

@komainu8 komainu8 marked this pull request as ready for review May 16, 2024 05:36
kou added 2 commits May 21, 2024 12:08
* Use DB_OBJ()->range
* Use domain not type
* Add missing grn_obj_unref()
@kou kou merged commit 59bd08a into main May 21, 2024
25 of 28 checks passed
@kou kou deleted the search-against-reference-vector-fail branch May 21, 2024 05:27
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 this pull request may close these issues.

Can't fulltext search against reference column of varchar vector
2 participants