Re: [GENERAL] Prefix search on all hstore values

2013-11-28 Thread Teodor Sigaev
My requirements can be relaxed to full text search, but the problem I had with that approach is I have strings in Chinese, and postgres doesn't seem to support it. Calling to_tsvector() on Chinese characters always returns an empty vector. Hm, check your locale settings. AFAIK, somebody uses F

Re: [GENERAL] Prefix search on all hstore values

2013-11-28 Thread Albert Chern
Thanks for the suggestions! My requirements can be relaxed to full text search, but the problem I had with that approach is I have strings in Chinese, and postgres doesn't seem to support it. Calling to_tsvector() on Chinese characters always returns an empty vector. A separate table will defini

Re: [GENERAL] Prefix search on all hstore values

2013-11-28 Thread Sergey Konoplev
On Thu, Nov 28, 2013 at 12:44 AM, Teodor Sigaev wrote: > Full-text search has this feature. > > # select to_tsvector('en_name=>yes, fr_name=>oui'::hstore::text) @@ 'en:*'; > ?column? > -- > t > > or (index only keys) > > select to_tsvector(akeys('en_name=>yes, fr_name=>oui'::hstore)::tex

Re: [GENERAL] Prefix search on all hstore values

2013-11-28 Thread Teodor Sigaev
Hi! Full-text search has this feature. # select to_tsvector('en_name=>yes, fr_name=>oui'::hstore::text) @@ 'en:*'; ?column? -- t or (index only keys) select to_tsvector(akeys('en_name=>yes, fr_name=>oui'::hstore)::text) @@ 'en:*'; ?column? -- t To speed up this queries yo

Re: [GENERAL] Prefix search on all hstore values

2013-11-28 Thread Sergey Konoplev
On Wed, Nov 27, 2013 at 6:49 PM, Albert Chern wrote: > I have an hstore column that stores a string in several arbitrary languages, > so something like this: > > "en" => "string in english", "zh" => "string in chinese", "fr" => "string in > french" > > Is it possible to construct an index that can

[GENERAL] Prefix search on all hstore values

2013-11-27 Thread Albert Chern
Hi, I have an hstore column that stores a string in several arbitrary languages, so something like this: "en" => "string in english", "zh" => "string in chinese", "fr" => "string in french" Is it possible to construct an index that can be used to determine if a query string is a prefix of ANY of