View groonga-dev.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update -qq && apt-get install -y build-essential | |
apt-get -y install software-properties-common | |
add-apt-repository -y universe | |
add-apt-repository -y ppa:groonga/ppa | |
apt-get update | |
apt-get install -y mecab libmecab-dev mecab-naist-jdic | |
apt-get install -y debhelper autotools-dev pkg-config liblz4-dev zlib1g-dev libmsgpack-dev libzmq3-dev libevent-dev libpcre3-dev libstemmer-dev libjemalloc-dev libssl-dev | |
apt-get install -y git |
View obj_search.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <groonga.h> | |
#include <time.h> | |
#include <limits.h> | |
grn_obj * | |
create_lexicon(grn_ctx *ctx, grn_obj *target_table, grn_obj *target_column, | |
char *lexicon_name) |
View score.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <groonga.h> | |
int main() | |
{ | |
grn_ctx ctx; | |
grn_obj *db, *table; | |
grn_id id; | |
const char *path = "score.grn"; |
View bench_pat_fuzzy.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <groonga.h> | |
#include <time.h> | |
#include <limits.h> | |
typedef struct { | |
double score; | |
int n_subrecs; |
View index_func.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugin_register functions/vector | |
[[0,0.0,0.0],true] | |
table_create Users TABLE_NO_KEY | |
[[0,0.0,0.0],true] | |
column_create Users names COLUMN_VECTOR ShortText | |
[[0,0.0,0.0],true] | |
table_create Words TABLE_PAT_KEY ShortText | |
[[0,0.0,0.0],true] | |
column_create Words users COLUMN_INDEX Users names | |
[[0,0.0,0.0],true] |
View reference_vector_with_blank_tag.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
table_create Tags TABLE_PAT_KEY ShortText | |
[[0,0.0,0.0],true] | |
table_create Memos TABLE_HASH_KEY ShortText | |
[[0,0.0,0.0],true] | |
column_create Memos tags COLUMN_VECTOR Tags | |
[[0,0.0,0.0],true] | |
load --table Memos | |
[ | |
{"_key": "Rroonga", "tags": ["Groonga", "Ruby"]}, | |
{"_key": "Groonga", "tags": ["Groonga"]}, |
View size.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% du -hc /share/all/post/base/36915/ #PGroonga 実際利用しているサイズ | |
518M /share/all/post/base/36915/ | |
518M 合計 | |
% ls -sl /share/all/post/base/36915/ |awk '{i+=$1} END{print i/1024}' #スパースを考慮して実際利用しているサイズ | |
517.461 | |
% ls -sl /share/all/post/base/36915/pgrn* |awk '{i+=$1} END{print i/1024}' # Groongaのみが実際に利用しているサイズ | |
425.984 |
View postgresql_insert.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$db = "localhost"; | |
$db_name = $argv[1]; | |
$table = "text"; | |
$article = $argv[2]; | |
if ($handle = opendir($article)) { | |
while (false !== ($file = readdir($handle))) { | |
echo "-------$file------\n"; |
View groonga-token-counter.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "groonga" | |
database_path = ARGV[0] | |
table_name = ARGV[1] | |
index_column_name = ARGV[2] | |
Groonga::Database.open(database_path) | |
index = Groonga["#{table_name}.#{index_column_name}"] | |
terms = Groonga::Hash.create(:key_type => Groonga::Type::SHORT_TEXT, | |
:value_type => Groonga::Type::UINT32) |
View groonga-token-counter.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <groonga.h> | |
#include <groonga/nfkc.h> | |
/* | |
Wikipedia ja 30万件 3.8G | |
real 1m12.745s | |
user 0m58.432s |
NewerOlder