MariaDB [flarum]> ALTER TABLE posts ENABLE KEYS;
Query OK, 0 rows affected, 1 warning (0.001 sec)
MariaDB [flarum]> ALTER TABLE posts_copy ADD CONSTRAINT FOREIGN KEY (`discussion_id`) REFERENCES `discussions` (`id`) ON DELETE CASCADE;
ERROR 1005 (HY000): reference table [flarum.discussions] is not mroonga table
Don't know how to build task '/tmp/tmp.06Em4lelUz/mroonga/mroonga-12.08.tar.gz'
/usr/lib/aarch64-linux-gnu/libmariadb3/plugin
, and I have added it to ld.so.conf
Because some fields need to be updated frequently, you want to distinguish multiple tables.What is the solution to federate other tables in search?
How to use join table in pgroonga_command select ? SQL like join tables.
int row = 0;
GRN_TABLE_EACH(&this->mw->ctx, res, 0, 0, id, &key, &key_size, &value, {
grn_obj_get_value(&this->mw->ctx, value, 1, &textbuf);
gchar *t = GRN_TEXT_VALUE(&textbuf);
row++;
});
@tim-lebedkov
We can use GRN_TABLE_EACH_BEGIN(context, table, cursor, id) { ... }GRN_TABLE_EACH_END(context, cursor)
.
I think GRN_TABLE_EACH_BEGIN(context, table, cursor, id) { ... }GRN_TABLE_EACH_END(context, cursor)
is more useful than GRN_TABLE_EACH
.
We don't need to prepare the third argument cursor
and the fourth argument id
.
Because these values allocate in the GRN_TABLE_EACH_BEGIN
macro.
In addition, we need to prepare column object.
For example is as below.
grn_obj *column = grn_obj_column(this->mw->ctx, res, your_column_name, your_column_name_length);
grn_obj textbuf;
GRN_TEXT_INIT(&textbuf, 0);
int row = 0;
GRN_TABLE_EACH_BEGIN(&this->mw->ctx, res, cursor, id) {
GRN_BULK_REWIND(&textbuf);
grn_obj_get_value(this->mw->ctx, column, id, &textbuf);
printf("%s\n", GRN_TEXT_VALUE(&text_buf)); // This is debug code.
gchar *t = GRN_TEXT_VALUE(&textbuf);
row++;
} GRN_TABLE_EACH_END(ctx, cursor);
Please refer to https://groonga.org/docs/reference/api/grn_obj.html#c.grn_obj_column about grn_obj_column.
Hi everyone, I want to search multiple tags in single query.
I've read this documentation how to search tag.
https://groonga.org/docs/tutorial/index.html#tag-search
select --table Video --query tags:@Variety --output_columns _key,title
but given the example, it only search for one tag
I want to search multiple tag like Variety, Animation, Sport by single query
how can i achieve that? thanks.
http://SERVER:10041/d/delete?table=posts&filter=published+%3D%3D+true
See also: https://groonga.org/docs/tutorial/network.html#how-to-send-a-command-to-an-http-server
hello everyone, I had a performance/tuning related question.
I am using a postgres database with pgroonga.
I'm searching a table using some user supplied pattern, and ranking the results along with a number of predefined patterns.
The problem is, is that searching using just the user supplied pattern is relatively fast (~2400 ms), but when adding in all the predefined patterns, it takes 14000+ms.
At first I thought I could use triggers on table inserts to populate another table with the results of the predefined pattern matches, to amortize the search when the write-once record is added.
This actually increased the time of the query, I suspect because joining to this table takes a significant amount of time (even with indices).
Is there a way to index a column on some search pattern? Such that lookups of "foo" are very fast since they will be repeated often?
I see there is grn_cache
, but I am not sure if that applies. If it does, is there an example of using it with pgroonga (or something to get me started)?
Thanks in advance.