2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
2011   3   28
mysql> CREATE TABLE t1 (                     >   c1 INT PRIMARY KEY,                     >   c2 TEXT,                     ...
mysql> insert into t1 values(1, "aa ii uu ee oo", null);                Query OK, 1 row affected (0.00 sec)               ...
2011   3   28
2011   3   28
package main {                    no utf8;                    my $path = tag_keys.db;                    my $pat = Groonga...
2011   3   28
2011   3   28
Upcoming SlideShare
Loading in …5
×

Yappo Groonga - with japanese search software history @ osdc.tw 2011

4,026 views
4,051 views

Published on

http://www.youtube.com/watch?v=e9lxTRTKHWU

1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
4,026
On SlideShare
0
From Embeds
0
Number of Embeds
1,480
Actions
Shares
0
Downloads
21
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Yappo Groonga - with japanese search software history @ osdc.tw 2011

  1. 1. 2011 3 28
  2. 2. 2011 3 28
  3. 3. 2011 3 28
  4. 4. 2011 3 28
  5. 5. 2011 3 28
  6. 6. 2011 3 28
  7. 7. 2011 3 28
  8. 8. 2011 3 28
  9. 9. 2011 3 28
  10. 10. 2011 3 28
  11. 11. 2011 3 28
  12. 12. 2011 3 28
  13. 13. 2011 3 28
  14. 14. 2011 3 28
  15. 15. 2011 3 28
  16. 16. 2011 3 28
  17. 17. 2011 3 28
  18. 18. 2011 3 28
  19. 19. 2011 3 28
  20. 20. 2011 3 28
  21. 21. 2011 3 28
  22. 22. 2011 3 28
  23. 23. 2011 3 28
  24. 24. 2011 3 28
  25. 25. 2011 3 28
  26. 26. 2011 3 28
  27. 27. 2011 3 28
  28. 28. 2011 3 28
  29. 29. 2011 3 28
  30. 30. 2011 3 28
  31. 31. 2011 3 28
  32. 32. 2011 3 28
  33. 33. 2011 3 28
  34. 34. 2011 3 28
  35. 35. 2011 3 28
  36. 36. 2011 3 28
  37. 37. 2011 3 28
  38. 38. 2011 3 28
  39. 39. 2011 3 28
  40. 40. 2011 3 28
  41. 41. 2011 3 28
  42. 42. 2011 3 28
  43. 43. 2011 3 28
  44. 44. 2011 3 28
  45. 45. 2011 3 28
  46. 46. 2011 3 28
  47. 47. mysql> CREATE TABLE t1 ( > c1 INT PRIMARY KEY, > c2 TEXT, > _score FLOAT, > FULLTEXT INDEX (c2) > ) ENGINE = groonga DEFAULT CHARSET utf8; Query OK, 0 rows affected (0.22 sec)2011 3 28
  48. 48. mysql> insert into t1 values(1, "aa ii uu ee oo", null); Query OK, 1 row affected (0.00 sec) mysql> insert into t1 values(2, "aa ii ii ii oo", null); Query OK, 1 row affected (0.00 sec) mysql> insert into t1 values(3, "dummy", null); Query OK, 1 row affected (0.00 sec) mysql> select * from t1 where match(c2) against("ii") order by _score desc; +----+----------------+--------+ | c1 | c2 | _score | +----+----------------+--------+ | 2 | aa ii ii ii oo | 3 | | 1 | aa ii uu ee oo | 1 | +----+----------------+--------+ 2 rows in set (0.00 sec)2011 3 28
  49. 49. 2011 3 28
  50. 50. 2011 3 28
  51. 51. package main {     no utf8;     my $path = tag_keys.db;     my $pat = Groonga::PatriciaTrie->new;     if (! $pat->open($path)) {         $pat->create($path, 1024, 1024, GRN_OBJ_KEY_VAR_SIZE | GRN_OBJ_KEY_NORMALIZE)             or die Groonga::PatriciaTrie create error;     }     $pat->add( , );     $pat->add(muteki, );     $pat->add(yappo, );     my $text = muTEki Yappo <> ;     my $replace = $pat->tag_keys($text, sub {         my($record, $word, $record_id) = @_;         sprintf <span class="keyword">%s(%s)</span>, $record, $word;     });     say $replace; } __END__2011 3 28 <span class="keyword">muTEki(muteki)</span>
  52. 52. 2011 3 28
  53. 53. 2011 3 28

×