Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    anthonydafc
    @anthonydafc
    BARRY ANDRE CORINNE RESOPHIE ERIC
    sorry i used select from trecherchepages where (ftexte &~ '.BARRY') AND (ftexte &~ '.*SOPHIE')
    Sutou Kouhei
    @kou
    select * from trecherchepages where (ftexte &~ 'BARRY') AND (ftexte &~ 'SOPHIE') matches a record that contains both BARRY and SOPHIE.
    Your sample data don't include such record.
    anthonydafc
    @anthonydafc
    the word RESOPHIE ends with SOPHIE, is that not possible to search with &~~?
    Sutou Kouhei
    @kou
    RESOPHIE doesn't contain BARRY.
    anthonydafc
    @anthonydafc
    i was looking for bith words : (ftexte &~ 'BARRY') AND (ftexte &~ 'SOPHIE')
    Sutou Kouhei
    @kou
    If you need more help, could you create a new issue https://github.com/pgroonga/pgroonga/issues/new with SQL to reproduce your case?
    CREATE TABLE ...;
    CREATE INDEX ...;
    INSERT ...;
    SELECT ...;
    anthonydafc
    @anthonydafc
    have you done a documentation for using &~ (regular expression) ?
    ふりだしにもどる
    @kenhys_twitter
    @anthonydafc
    @anthonydafc there is &~documentation: https://pgroonga.github.io/reference/operators/regular-expression-v2.html , but as kou mentioned, creating a new issue may be appropriate in this case for getting more help.
    frankietaylor
    @frankietaylor
    I tried to create a simple pat table with UInt32 key type and its failing to load data
    table_create --name Site --flags TABLE_PAT_KEY --key_type UInt32 --default_tokenizer TokenBigram --normalizer NormalizerAuto
    column_create --table Site --name title --type ShortText
    load --table Site
    [{"_key":"1","title":"This is test record 1!"}]
    
    or 
    load --table Site
    [{"_key":1,"title":"This is test record 1!"}]
    
    Error:
    [[-22,1570939085.112,0.03200006484985352,"[table][add][pat] failed to add: #<key 1 table:#<pat Site key:UInt32>>",[["grn_table_add","db.c",1642]]],0]
    If I switch to key_type ShortText, its working
    ふりだしにもどる
    @kenhys_twitter
    @frankietaylor If you use key_type UInt32, there is no need to specify -default_tokenizer TokenBigram --normalizer NormalizerAuto. As you has mentioned, if you use key_type ShortText, it's ok because tokenizer and normalizer is aimed to apply for text type.
    Amy
    @WinteryFox
    how can I match against any form of any verb? for instance I search for 支えている and it'll return anything containing any form of 支える
    and what about plurals?
    this doesn't seem to support most of the important features of psql's own full text search solutions
    (like plurals, verb forms etc)
    ふりだしにもどる
    @kenhys_twitter

    It seems that there is no simple way to support stemming for '支えている' at the moment. But there is a workaround to do similar thing.

    1. Use pgroonga_query_expand function for searching synonyms. (ref https://pgroonga.github.io/reference/functions/pgroonga-query-expand.html )
    2. is the way to use expanded query for searching. It means that you can expand '支える' to '支える' OR '支えている' OR '支えた' and so on. Expanded query is available by pgroonga_query_expand function. The one drawback is needed to maintain sysnonyms table for required verbs. (See Synonyms groups section in above document)

    Here is the sample to do it:

    CREATE TABLE synonym_groups ( synonyms text[]);
    CREATE INDEX synonym_groups_synonyms ON synonym_groups USING pgroonga (synonyms pgroonga_text_array_term_search_ops_v2);
    INSERT INTO synonym_groups VALUES (ARRAY['支える', '支えている', '支えた']);
    INSERT INTO memos (title) VALUES ('〇〇を支える技術');
    INSERT INTO memos (title) VALUES ('〇〇を支えている技術');
    INSERT INTO memos (title) VALUES ('〇〇を支えた技術');
    INSERT INTO memos (title) VALUES ('〇〇を支えし技術');
    
    # select * from memos where title &@~ pgroonga_query_expand('synonym_groups', 'synonyms', 'synonyms', '支える');
     〇〇を支える技術
     〇〇を支えている技術
     〇〇を支えた技術

    As It takes costs for many supported verbs, so supporting stemming query in your application layer may be better.

    Amy
    @WinteryFox
    wouldn't that mean running a query for every form of every verb though? seems like it'd be more tedious
    Amy
    @WinteryFox
    I've found a solution that better suits my needs (https://github.com/oknj/textsearch_ja), thanks for the help anyway
    Horimoto Yasuhiro
    @komainu8

    We added a new option(use_base_form) into tokenizer(TokenMecab).
    We can match against any form of any verb by this option.

    For example, if we search "支えた" using this option, "支える" is hit also.

    This option can use as below from the next release.

    CREATE EXTENSION pgroonga;
    
    CREATE TABLE memos (
      id integer,
      content text
    );
    
    CREATE INDEX base_form_index on memos
      USING pgroonga (content)
      WITH (tokenizer='TokenMecab("use_base_form", true)');
    
    INSERT INTO memos VALUES (1, '支える');
    INSERT INTO memos VALUES (2, '支えた');
    
    SELECT * FROM memos WHERE content &@ '支える';
    
    --  id | content 
    -- ----+---------
    --   1 | 支える
    --   2 | 支えた
    -- (2 row)
    Arpit Sharma
    @arpit551
    I am getting this error The repository 'http://ppa.launchpad.net/groonga/ppa/ubuntu focal Release' does not have a Release file.
    Sutou Kouhei
    @kou
    Could you show how to reproduce it?
    Arpit Sharma
    @arpit551
    Actually this is because currently, groonga do not have a release for ubuntu focal so I build it from the source.
    thanks
    James Leong
    @jimjimleong_twitter

    I pgroonga is found a bug in the replica db.

    select * from table where xxx &@~ 'search'

    it is fine

    select * from view where xxx &@~ 'search'

    will trigger ERROR: pgroonga: object isn't found: <Sources2813810>
    when pgroonga.enable_wal = false
    To fix the problem, add pgroonga.enable_wal = on in postgresql.conf and pg_ctl reload the slave db sever.
    However, if pgroonga.enable_wal = on is kept, the slave pgroonga will cause postmaster crash and stop the service.

    Horimoto Yasuhiro
    @komainu8
    Could you open an issue from here https://github.com/pgroonga/pgroonga/issues and write full SQLs (CREATE TABLE, CREATE INDEX, INSERT, SELECT, ...) to reproduce the case?
    And, could you attach your ${PGDATA}/pgroonga.log and ${PG_DATA}/log/postgresql-xxx.log to the above issue?
    Gábor Nagymajtényi
    @zuzmo_twitter
    Hello, Is there anybody, who tried to use groonga on mobile platforms embedded? Is there a good choice ? Next question is there any newer language binding to lua than the 5years old repo i found on https://github.com/mah0x211/lua-groonga
    Sutou Kouhei
    @kou
    Does your mobile platform have enough memory?
    If it doesn't, Groonga isn't suitable.
    Gábor Nagymajtényi
    @zuzmo_twitter
    As an usual mobile phone today: min 2GB RAM , android 7, ios ...
    Sutou Kouhei
    @kou
    How many data size do you want to use?
    Gábor Nagymajtényi
    @zuzmo_twitter
    not too much, less than 100MB raw which need to be persist: mainly chat, and some attachments. key, value , full text search, json
    Sutou Kouhei
    @kou
    Groonga will work for the data.
    Lua bindings aren't maintained.
    Can you run Groonga as a HTTP server?
    Do you need to use Groonga as a library?
    Is your Lua interpreter the original Lua? LuaJIT?
    Gábor Nagymajtényi
    @zuzmo_twitter
    https://standby.network - on the phones we use as an embedded lib, with lua5.4, a network service we use as an https microservice ( for pairing mobiles in the p2p network )
    the mobile stack : flutter and lua backend
    Sutou Kouhei
    @kou
    Creating bindings of grn_ctx_send(), grn_ctx_recv() and some related functions will be the shorter path to use Groonga from Lua.
    You can use the command https://groonga.org/docs/reference/command.html API with grn_ctx_send() and grn_ctx_recv().
    You can use Groonga as a library. You don't need to run Groonga as a HTTP server to use the command API.
    Gábor Nagymajtényi
    @zuzmo_twitter
    i checked in pgroonga. i can port to lua-groonga
    Sutou Kouhei
    @kou
    You need to add more bindings with lua-groonga approach.
    It uses raw Groonga API to process data in Groonga.
    Gábor Nagymajtényi
    @zuzmo_twitter
    only the objects are missing
    db, tables are ready
    Sutou Kouhei
    @kou
    columns are needed.
    Gábor Nagymajtényi
    @zuzmo_twitter
    well