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

bug, return duplicate tuples #5

Closed
digoal opened this issue Aug 17, 2016 · 3 comments
Closed

bug, return duplicate tuples #5

digoal opened this issue Aug 17, 2016 · 3 comments

Comments

@digoal
Copy link

digoal commented Aug 17, 2016

9.6 beta4 , has a bug:

postgres=# insert into test15 values (to_tsvector('jiebacfg', 'hello china, i''m digoal')), (to_tsvector('jiebacfg', 'hello world, i''m postgresql')), (to_tsvector('jiebacfg', 'how are you, i''m digoal'));
INSERT 0 3
postgres=# select * from test15;
                         c1                          
-----------------------------------------------------
 ' ':2,5,9 'china':3 'digoal':10 'hello':1 'm':8
 ' ':2,5,9 'hello':1 'm':8 'postgresql':10 'world':3
 ' ':2,4,7,11 'digoal':12 'm':10
(3 rows)

postgres=# create index idx_test15 on test15 using rum(c1 rum_tsvector_ops);
CREATE INDEX
postgres=# select *,c1 <=> to_tsquery('hello') from test15;
                         c1                          | ?column? 
-----------------------------------------------------+----------
 ' ':2,5,9 'china':3 'digoal':10 'hello':1 'm':8     |  16.4493
 ' ':2,5,9 'hello':1 'm':8 'postgresql':10 'world':3 |  16.4493
 ' ':2,4,7,11 'digoal':12 'm':10                     | Infinity
(3 rows)

return duplicate tuples;
postgres=# select ctid,*,c1 <=> to_tsquery('hello') from test15 order by c1 <=> to_tsquery('hello');
 ctid  |                         c1                          | ?column? 
-------+-----------------------------------------------------+----------
 (0,1) | ' ':2,5,9 'china':3 'digoal':10 'hello':1 'm':8     |  16.4493
 (0,2) | ' ':2,5,9 'hello':1 'm':8 'postgresql':10 'world':3 |  16.4493
 (0,1) | ' ':2,5,9 'china':3 'digoal':10 'hello':1 'm':8     |  16.4493
 (0,2) | ' ':2,5,9 'hello':1 'm':8 'postgresql':10 'world':3 |  16.4493
 (0,3) | ' ':2,4,7,11 'digoal':12 'm':10                     | Infinity
(5 rows)
@za-arthur
Copy link
Contributor

Thank you for the issue! We will fix this.

za-arthur pushed a commit that referenced this issue Aug 19, 2016
@za-arthur
Copy link
Contributor

Fixed. Check please.

@digoal
Copy link
Author

digoal commented Aug 20, 2016

Thank you, it's correct now.

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

No branches or pull requests

2 participants