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

[YSQL] text search configuration "english" does not exist #1979

Closed
jaki opened this issue Aug 6, 2019 · 2 comments
Closed

[YSQL] text search configuration "english" does not exist #1979

jaki opened this issue Aug 6, 2019 · 2 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL)
Milestone

Comments

@jaki
Copy link
Contributor

jaki commented Aug 6, 2019

Running some lines in the json regress test manually looks like the following:

postgres=# select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "b": ["the eee fff ggg"], "c": {"d": "hhh. iii"}}'::json);
ERROR:  text search configuration "english" does not exist
LINE 1: select to_tsvector('english', '{"a": "aaa in bbb ddd ccc", "...
                           ^
postgres=# select to_tsvector('{"a": "aaa in bbb ddd ccc", "b": ["the eee fff ggg"], "c": {"d": "hhh. iii"}}'::json);
ERROR:  text search configuration "pg_catalog.english" does not exist

These should not error.

@jaki jaki added the area/ysql Yugabyte SQL (YSQL) label Aug 6, 2019
jaki pushed a commit to jaki/yugabyte-db that referenced this issue Aug 22, 2019
Previously, all statements could not be uncommented because of issues
with `json_populate_record`.  Thanks to the RBAC diff that got pushed
(e89d75b), these statements can be uncommented without errors.
Uncomment several statements up to the next failing statement,
`to_tsvector`, which is raised as issue yugabyte#1979.
@ndeodhar ndeodhar assigned Zhongweizhao and unassigned ndeodhar Sep 11, 2019
@ndeodhar
Copy link
Contributor

During initdb, we've disabled setting up dictionary for YB. We should enable that.
Code from initdb.c:

if (!IsYugaByteGlobalClusterInitdb())
	{
		setup_conversion(cmdfd);

		setup_dictionary(cmdfd);
	}

@ndeodhar ndeodhar assigned ndeodhar and unassigned Zhongweizhao Jan 17, 2020
@jaki jaki assigned d-uspenskiy and unassigned ndeodhar Jan 29, 2021
@m-iancu m-iancu added this to the 2.7.x milestone Apr 21, 2021
@m-iancu m-iancu assigned frozenspider and unassigned d-uspenskiy Apr 21, 2021
@m-iancu m-iancu assigned yifanguan and unassigned frozenspider Aug 26, 2021
yifanguan added a commit that referenced this issue Nov 29, 2021
Summary:
This diff supports the PG11 text search configuration feature. Default supported languages are: danish, dutch, english, finnish, french, german, hungarian, italian, norwegian, portuguese, romanian, russian,   spanish, swedish, turkish.
initdb.c is modifed. Relevant grammar, regression tests, and the corresponding migration script are added. AlterTSDictionaryStmt and AlterTSConfigurationStmt are not enabled in this diff.

A text search configuration specifies all options necessary to transform a document into a tsvector: the parser to use to break text into tokens, and the dictionaries to use to transform each token into a lexeme. Every call of to_tsvector or to_tsquery needs a text search configuration to perform its processing.
Example:
```
SELECT to_tsvector('english', 'The Fat Rats');
   to_tsvector
-----------------
 'fat':2 'rat':3
```

Users can also create custom configurations.
Example:
```
CREATE TEXT SEARCH CONFIGURATION public.pg ( COPY = pg_catalog.english );

CREATE TEXT SEARCH DICTIONARY ispell (
                        Template=ispell,
                        DictFile=ispell_sample,
                        AffFile=ispell_sample
);
```

Test Plan:
Modify existing regression tests:
ybd debug --java-test 'org.yb.pgsql.TestPgRegressTypesString'
ybd debug --java-test 'org.yb.pgsql.TestPgRegressPgMiscIndependent'
ybd debug --java-test 'org.yb.pgsql.TestPgRegressFeature'
ybd debug --java-test 'org.yb.pgsql.TestPgRegressExtension'

Run the following test to test initdb migration:
ybd release --java-test 'org.yb.pgsql.TestYsqlUpgrade'

Reviewers: mihnea, jason, alex

Reviewed By: jason, alex

Subscribers: jenkins-bot, bogdan, sanketh, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D13212
@yifanguan
Copy link
Contributor

Feature supported by the following commit -> 509b950

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL)
Projects
None yet
Development

No branches or pull requests

7 participants