| 1 |
table_create Documents TABLE_NO_KEY |
| 2 |
column_create Documents title COLUMN_SCALAR ShortText |
| 3 |
column_create Documents content COLUMN_SCALAR Text |
| 4 |
|
| 5 |
table_create Terms TABLE_PAT_KEY|KEY_NORMALIZE ShortText \ |
| 6 |
--default_tokenizer TokenBigram |
| 7 |
column_create Terms document_title_index COLUMN_INDEX|WITH_POSITION \ |
| 8 |
Documents title |
| 9 |
column_create Terms document_content_index COLUMN_INDEX|WITH_POSITION \ |
| 10 |
Documents content |
| 11 |
|
| 12 |
load --table Documents |
| 13 |
[ |
| 14 |
["title", "content"], |
| 15 |
["Groonga overview", "Groonga is a fast and accurate full text search engine based on inverted index."], |
| 16 |
["Full text search and Instant update", "In widely used DBMSs, updates are immediately processed, for example, a newly registered record appears in the result of the next query."], |
| 17 |
["Column store and aggregate query", "People can collect more than enough data in the Internet era."] |
| 18 |
] |
| 19 |
|
| 20 |
select Documents \ |
| 21 |
--match_columns title||content --query 'groonga' \ |
| 22 |
--output_columns '_id, snippet_html(title + " " + content)' |