Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
    Sutou Kouhei
    If you need more help, could you create a new issue https://github.com/pgroonga/pgroonga/issues/new with SQL to reproduce your case?
    INSERT ...;
    SELECT ...;
    have you done a documentation for using &~ (regular expression) ?
    @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.
    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!"}]
    load --table Site
    [{"_key":1,"title":"This is test record 1!"}]
    [[-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
    @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.
    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)

    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.

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

    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
    I am getting this error The repository 'http://ppa.launchpad.net/groonga/ppa/ubuntu focal Release' does not have a Release file.
    Sutou Kouhei
    Could you show how to reproduce it?
    Arpit Sharma
    Actually this is because currently, groonga do not have a release for ubuntu focal so I build it from the source.
    James Leong

    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
    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
    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
    Does your mobile platform have enough memory?
    If it doesn't, Groonga isn't suitable.
    Gábor Nagymajtényi
    As an usual mobile phone today: min 2GB RAM , android 7, ios ...
    Sutou Kouhei
    How many data size do you want to use?
    Gábor Nagymajtényi
    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
    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
    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
    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
    i checked in pgroonga. i can port to lua-groonga
    Sutou Kouhei
    You need to add more bindings with lua-groonga approach.
    It uses raw Groonga API to process data in Groonga.
    Gábor Nagymajtényi
    only the objects are missing
    db, tables are ready
    Sutou Kouhei
    columns are needed.
    Gábor Nagymajtényi
    the groonga/options.h missing in the newer api
    i will check the php and rust bindings
    Gábor Nagymajtényi
    thanks your feedback!
    Has anyone had experience in loading pgroonga extension on Postgres-XL 10r1.1?
    I get an error:
    • "ERROR: Internal subtransactions not supported in Postgres-XL",
    • "CONTEXT: PL / pgSQL function inline_code_block line 2 during statement block entry"
    Sutou Kouhei
    Could you open an issue including how to reproduce it from scratch? It should include how to install Postgres-XL, PGroonga and so on.
    eric jonas

    Hi all,

    I need some help.

    I am currently using MariaDB 10.1 and the full text search can't work with infix %..%

    I am hoping Groonga (or MGroonga) can help me to achieve this limitation. Managed to install MGroonga inside MariaDB 10.1.

    All my existing tables are InnoDB.

    I did this

    create table salesorder_mroonga engine=Mroonga select * from salesorder;

    managed to create the table successful.

    So i add the fulltext index

    alter table salesorder_mroonga add fulltext index pName (productName);

    or using this way

    create table salesorder_mroonga(fulltext index (productName)) engine=Mroonga select * from salesorder;

    Can add, but the fulltext index will show null for cardinality.

    A fulltext index in InnoDB table salesorder will have 30,000 for cardinality.

    So if I run this query, it will return 0.

    select from salesorder_mroonga where match(productName) against ('Al*' in boolean mode);

    Any idea why I add a fulltext index won't work?