droonga-engine 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.dir-locals.el +3 -0
- data/.gitignore +6 -0
- data/.travis.yml +15 -0
- data/.yardopts +7 -0
- data/Gemfile +66 -0
- data/LICENSE.txt +14 -0
- data/README.md +17 -0
- data/Rakefile +64 -0
- data/benchmark/benchmark.rb +123 -0
- data/benchmark/utils.rb +246 -0
- data/benchmark/watch/benchmark-notify.rb +143 -0
- data/benchmark/watch/benchmark-notify.sh +20 -0
- data/benchmark/watch/benchmark-publish.rb +120 -0
- data/benchmark/watch/benchmark-scan.rb +213 -0
- data/bin/droonga-catalog-generate +103 -0
- data/bin/droonga-engine +20 -0
- data/bin/droonga-engine-service +20 -0
- data/doc/text/news.md +106 -0
- data/droonga-engine.gemspec +52 -0
- data/lib/droonga/adapter.rb +48 -0
- data/lib/droonga/adapter_runner.rb +104 -0
- data/lib/droonga/catalog/base.rb +41 -0
- data/lib/droonga/catalog/collection_volume.rb +106 -0
- data/lib/droonga/catalog/dataset.rb +69 -0
- data/lib/droonga/catalog/errors.rb +113 -0
- data/lib/droonga/catalog/schema.rb +186 -0
- data/lib/droonga/catalog/single_volume.rb +28 -0
- data/lib/droonga/catalog/slice.rb +41 -0
- data/lib/droonga/catalog/version1.rb +427 -0
- data/lib/droonga/catalog/version2.rb +96 -0
- data/lib/droonga/catalog/version2_validator.rb +63 -0
- data/lib/droonga/catalog/volume.rb +33 -0
- data/lib/droonga/catalog/volume_collection.rb +56 -0
- data/lib/droonga/catalog_generator.rb +156 -0
- data/lib/droonga/catalog_loader.rb +56 -0
- data/lib/droonga/catalog_observer.rb +83 -0
- data/lib/droonga/collector.rb +38 -0
- data/lib/droonga/collector_message.rb +71 -0
- data/lib/droonga/collector_runner.rb +64 -0
- data/lib/droonga/collectors/and.rb +26 -0
- data/lib/droonga/collectors/or.rb +26 -0
- data/lib/droonga/collectors/sum.rb +26 -0
- data/lib/droonga/collectors.rb +18 -0
- data/lib/droonga/dispatcher.rb +326 -0
- data/lib/droonga/distributed_command_planner.rb +179 -0
- data/lib/droonga/distributor.rb +87 -0
- data/lib/droonga/engine/command/droonga_engine.rb +441 -0
- data/lib/droonga/engine/version.rb +20 -0
- data/lib/droonga/engine.rb +80 -0
- data/lib/droonga/engine_state.rb +79 -0
- data/lib/droonga/error.rb +73 -0
- data/lib/droonga/error_messages.rb +33 -0
- data/lib/droonga/event_loop.rb +46 -0
- data/lib/droonga/farm.rb +58 -0
- data/lib/droonga/fluent_message_receiver.rb +191 -0
- data/lib/droonga/fluent_message_sender.rb +140 -0
- data/lib/droonga/forwarder.rb +119 -0
- data/lib/droonga/handler.rb +49 -0
- data/lib/droonga/handler_message.rb +61 -0
- data/lib/droonga/handler_messenger.rb +119 -0
- data/lib/droonga/handler_runner.rb +125 -0
- data/lib/droonga/input_message.rb +51 -0
- data/lib/droonga/job_protocol.rb +20 -0
- data/lib/droonga/job_pusher.rb +179 -0
- data/lib/droonga/job_receiver.rb +70 -0
- data/lib/droonga/loggable.rb +29 -0
- data/lib/droonga/logger.rb +142 -0
- data/lib/droonga/message_matcher.rb +109 -0
- data/lib/droonga/output_message.rb +55 -0
- data/lib/droonga/planner.rb +47 -0
- data/lib/droonga/pluggable.rb +31 -0
- data/lib/droonga/plugin/metadata/adapter_input_message.rb +39 -0
- data/lib/droonga/plugin/metadata/adapter_output_message.rb +39 -0
- data/lib/droonga/plugin/metadata/collector_message.rb +39 -0
- data/lib/droonga/plugin/metadata/handler_action.rb +39 -0
- data/lib/droonga/plugin/metadata/input_message.rb +54 -0
- data/lib/droonga/plugin.rb +43 -0
- data/lib/droonga/plugin_loader.rb +63 -0
- data/lib/droonga/plugin_registry.rb +66 -0
- data/lib/droonga/plugins/basic.rb +54 -0
- data/lib/droonga/plugins/crud.rb +145 -0
- data/lib/droonga/plugins/dump.rb +97 -0
- data/lib/droonga/plugins/error.rb +51 -0
- data/lib/droonga/plugins/groonga/column_create.rb +123 -0
- data/lib/droonga/plugins/groonga/column_list.rb +124 -0
- data/lib/droonga/plugins/groonga/column_remove.rb +65 -0
- data/lib/droonga/plugins/groonga/column_rename.rb +67 -0
- data/lib/droonga/plugins/groonga/delete.rb +117 -0
- data/lib/droonga/plugins/groonga/generic_command.rb +105 -0
- data/lib/droonga/plugins/groonga/generic_response.rb +43 -0
- data/lib/droonga/plugins/groonga/select.rb +236 -0
- data/lib/droonga/plugins/groonga/table_create.rb +111 -0
- data/lib/droonga/plugins/groonga/table_list.rb +120 -0
- data/lib/droonga/plugins/groonga/table_remove.rb +57 -0
- data/lib/droonga/plugins/groonga.rb +37 -0
- data/lib/droonga/plugins/search/distributed_search_planner.rb +407 -0
- data/lib/droonga/plugins/search.rb +146 -0
- data/lib/droonga/plugins/watch.rb +178 -0
- data/lib/droonga/processor.rb +63 -0
- data/lib/droonga/reducer.rb +169 -0
- data/lib/droonga/replier.rb +49 -0
- data/lib/droonga/schema_applier.rb +167 -0
- data/lib/droonga/searcher/mecab_filter.rb +67 -0
- data/lib/droonga/searcher.rb +733 -0
- data/lib/droonga/server.rb +45 -0
- data/lib/droonga/session.rb +99 -0
- data/lib/droonga/single_step.rb +68 -0
- data/lib/droonga/single_step_definition.rb +54 -0
- data/lib/droonga/slice.rb +122 -0
- data/lib/droonga/status_code.rb +25 -0
- data/lib/droonga/step_runner.rb +64 -0
- data/lib/droonga/sweeper.rb +42 -0
- data/lib/droonga/test/stub_handler.rb +37 -0
- data/lib/droonga/test/stub_handler_message.rb +35 -0
- data/lib/droonga/test/stub_handler_messenger.rb +34 -0
- data/lib/droonga/test/stub_planner.rb +31 -0
- data/lib/droonga/test.rb +21 -0
- data/lib/droonga/watch_schema.rb +92 -0
- data/lib/droonga/watcher.rb +257 -0
- data/lib/droonga/worker.rb +61 -0
- data/sample/cluster/catalog.json +42 -0
- data/sample/mecab_filter/data.grn +7 -0
- data/sample/mecab_filter/ddl.grn +7 -0
- data/sample/mecab_filter/search_with_mecab_filter.json +21 -0
- data/sample/mecab_filter/search_without_mecab_filter.json +21 -0
- data/test/command/config/default/catalog.json +85 -0
- data/test/command/config/default/fluentd.conf +11 -0
- data/test/command/config/version1/catalog.json +68 -0
- data/test/command/config/version1/fluentd.conf +11 -0
- data/test/command/fixture/documents.jsons +208 -0
- data/test/command/fixture/event.jsons +41 -0
- data/test/command/fixture/user-table-array.jsons +38 -0
- data/test/command/fixture/user-table.jsons +47 -0
- data/test/command/run-test.rb +34 -0
- data/test/command/suite/add/dimension/column.catalog.json +28 -0
- data/test/command/suite/add/dimension/column.expected +41 -0
- data/test/command/suite/add/dimension/column.test +51 -0
- data/test/command/suite/add/dimension/integer.catalog.json +19 -0
- data/test/command/suite/add/dimension/integer.expected +41 -0
- data/test/command/suite/add/dimension/integer.test +51 -0
- data/test/command/suite/add/error/invalid-integer.expected +46 -0
- data/test/command/suite/add/error/invalid-integer.test +12 -0
- data/test/command/suite/add/error/invalid-time.expected +46 -0
- data/test/command/suite/add/error/invalid-time.test +12 -0
- data/test/command/suite/add/error/missing-key.expected +25 -0
- data/test/command/suite/add/error/missing-key.test +16 -0
- data/test/command/suite/add/error/missing-table.expected +25 -0
- data/test/command/suite/add/error/missing-table.test +16 -0
- data/test/command/suite/add/error/unknown-column.expected +46 -0
- data/test/command/suite/add/error/unknown-column.test +12 -0
- data/test/command/suite/add/error/unknown-table.expected +25 -0
- data/test/command/suite/add/error/unknown-table.test +17 -0
- data/test/command/suite/add/minimum.expected +6 -0
- data/test/command/suite/add/minimum.test +11 -0
- data/test/command/suite/add/with-values.expected +6 -0
- data/test/command/suite/add/with-values.test +17 -0
- data/test/command/suite/add/without-key.expected +6 -0
- data/test/command/suite/add/without-key.test +16 -0
- data/test/command/suite/groonga/column_create/scalar.expected +26 -0
- data/test/command/suite/groonga/column_create/scalar.test +17 -0
- data/test/command/suite/groonga/column_create/unknown-table.expected +14 -0
- data/test/command/suite/groonga/column_create/unknown-table.test +7 -0
- data/test/command/suite/groonga/column_create/vector.expected +26 -0
- data/test/command/suite/groonga/column_create/vector.test +18 -0
- data/test/command/suite/groonga/column_list/success.expected +86 -0
- data/test/command/suite/groonga/column_list/success.test +24 -0
- data/test/command/suite/groonga/column_list/unknown-table.expected +13 -0
- data/test/command/suite/groonga/column_list/unknown-table.test +7 -0
- data/test/command/suite/groonga/column_remove/success.expected +39 -0
- data/test/command/suite/groonga/column_remove/success.test +25 -0
- data/test/command/suite/groonga/column_remove/unknown-column.expected +27 -0
- data/test/command/suite/groonga/column_remove/unknown-column.test +16 -0
- data/test/command/suite/groonga/column_remove/unknown-table.expected +14 -0
- data/test/command/suite/groonga/column_remove/unknown-table.test +7 -0
- data/test/command/suite/groonga/column_rename/success.expected +39 -0
- data/test/command/suite/groonga/column_rename/success.test +26 -0
- data/test/command/suite/groonga/column_rename/unknown-column.expected +27 -0
- data/test/command/suite/groonga/column_rename/unknown-column.test +16 -0
- data/test/command/suite/groonga/column_rename/unknown-table.expected +14 -0
- data/test/command/suite/groonga/column_rename/unknown-table.test +7 -0
- data/test/command/suite/groonga/delete/duplicated-identifiers.expected +27 -0
- data/test/command/suite/groonga/delete/duplicated-identifiers.test +17 -0
- data/test/command/suite/groonga/delete/filter.expected +19 -0
- data/test/command/suite/groonga/delete/filter.test +19 -0
- data/test/command/suite/groonga/delete/invalid-filter.expected +14 -0
- data/test/command/suite/groonga/delete/invalid-filter.test +9 -0
- data/test/command/suite/groonga/delete/no-identifier.expected +27 -0
- data/test/command/suite/groonga/delete/no-identifier.test +15 -0
- data/test/command/suite/groonga/delete/success.expected +19 -0
- data/test/command/suite/groonga/delete/success.test +19 -0
- data/test/command/suite/groonga/delete/unknown-table.expected +14 -0
- data/test/command/suite/groonga/delete/unknown-table.test +7 -0
- data/test/command/suite/groonga/select/minimum.expected +22 -0
- data/test/command/suite/groonga/select/minimum.test +8 -0
- data/test/command/suite/groonga/table_create/array.expected +14 -0
- data/test/command/suite/groonga/table_create/array.test +8 -0
- data/test/command/suite/groonga/table_create/hash.expected +13 -0
- data/test/command/suite/groonga/table_create/hash.test +8 -0
- data/test/command/suite/groonga/table_list/success.expected +71 -0
- data/test/command/suite/groonga/table_list/success.test +15 -0
- data/test/command/suite/groonga/table_remove/success.expected +13 -0
- data/test/command/suite/groonga/table_remove/success.test +8 -0
- data/test/command/suite/groonga/table_remove/unknown-table.expected +14 -0
- data/test/command/suite/groonga/table_remove/unknown-table.test +7 -0
- data/test/command/suite/message/error/missing-dataset.expected +9 -0
- data/test/command/suite/message/error/missing-dataset.test +5 -0
- data/test/command/suite/message/error/unknown-dataset.expected +9 -0
- data/test/command/suite/message/error/unknown-dataset.test +6 -0
- data/test/command/suite/message/error/unknown-type.expected +9 -0
- data/test/command/suite/message/error/unknown-type.test +6 -0
- data/test/command/suite/search/adjusters/multiple.catalog.json +38 -0
- data/test/command/suite/search/adjusters/multiple.expected +19 -0
- data/test/command/suite/search/adjusters/multiple.test +75 -0
- data/test/command/suite/search/adjusters/one.catalog.json +38 -0
- data/test/command/suite/search/adjusters/one.expected +19 -0
- data/test/command/suite/search/adjusters/one.test +66 -0
- data/test/command/suite/search/attributes/array.expected +21 -0
- data/test/command/suite/search/attributes/array.test +28 -0
- data/test/command/suite/search/attributes/hash.expected +30 -0
- data/test/command/suite/search/attributes/hash.test +36 -0
- data/test/command/suite/search/complex.expected +48 -0
- data/test/command/suite/search/complex.test +23 -0
- data/test/command/suite/search/condition/nested.expected +15 -0
- data/test/command/suite/search/condition/nested.test +27 -0
- data/test/command/suite/search/condition/query/nonexistent_column.catalog.json +37 -0
- data/test/command/suite/search/condition/query/nonexistent_column.expected +48 -0
- data/test/command/suite/search/condition/query/nonexistent_column.test +33 -0
- data/test/command/suite/search/condition/query/syntax_error.catalog.json +36 -0
- data/test/command/suite/search/condition/query/syntax_error.expected +48 -0
- data/test/command/suite/search/condition/query/syntax_error.test +33 -0
- data/test/command/suite/search/condition/query.expected +24 -0
- data/test/command/suite/search/condition/query.test +23 -0
- data/test/command/suite/search/condition/script.expected +24 -0
- data/test/command/suite/search/condition/script.test +26 -0
- data/test/command/suite/search/error/cyclic-source.expected +14 -0
- data/test/command/suite/search/error/cyclic-source.test +12 -0
- data/test/command/suite/search/error/deeply-cyclic-source.expected +17 -0
- data/test/command/suite/search/error/deeply-cyclic-source.test +15 -0
- data/test/command/suite/search/error/missing-source-parameter.expected +13 -0
- data/test/command/suite/search/error/missing-source-parameter.test +11 -0
- data/test/command/suite/search/error/no-query.expected +9 -0
- data/test/command/suite/search/error/no-query.test +7 -0
- data/test/command/suite/search/error/unknown-source.expected +52 -0
- data/test/command/suite/search/error/unknown-source.test +12 -0
- data/test/command/suite/search/group/count.expected +10 -0
- data/test/command/suite/search/group/count.test +18 -0
- data/test/command/suite/search/group/limit.expected +15 -0
- data/test/command/suite/search/group/limit.test +20 -0
- data/test/command/suite/search/group/string.expected +32 -0
- data/test/command/suite/search/group/string.test +40 -0
- data/test/command/suite/search/group/subrecord/with-sort.catalog.json +33 -0
- data/test/command/suite/search/group/subrecord/with-sort.expected +30 -0
- data/test/command/suite/search/group/subrecord/with-sort.test +81 -0
- data/test/command/suite/search/multiple/chained.expected +41 -0
- data/test/command/suite/search/multiple/chained.test +39 -0
- data/test/command/suite/search/multiple/parallel.expected +35 -0
- data/test/command/suite/search/multiple/parallel.test +35 -0
- data/test/command/suite/search/output/attributes/invalid.catalog.json +13 -0
- data/test/command/suite/search/output/attributes/invalid.expected +44 -0
- data/test/command/suite/search/output/attributes/invalid.test +28 -0
- data/test/command/suite/search/range/only-output.expected +24 -0
- data/test/command/suite/search/range/only-output.test +23 -0
- data/test/command/suite/search/range/only-sort.expected +24 -0
- data/test/command/suite/search/range/only-sort.test +26 -0
- data/test/command/suite/search/range/sort-and-output.expected +21 -0
- data/test/command/suite/search/range/sort-and-output.test +27 -0
- data/test/command/suite/search/range/too-large-output-offset.expected +12 -0
- data/test/command/suite/search/range/too-large-output-offset.test +23 -0
- data/test/command/suite/search/range/too-large-sort-offset.expected +12 -0
- data/test/command/suite/search/range/too-large-sort-offset.test +26 -0
- data/test/command/suite/search/response/elapsed_time.catalog.json +13 -0
- data/test/command/suite/search/response/elapsed_time.expected +11 -0
- data/test/command/suite/search/response/elapsed_time.test +26 -0
- data/test/command/suite/search/response/records/value/time.expected +20 -0
- data/test/command/suite/search/response/records/value/time.test +22 -0
- data/test/command/suite/search/simple.expected +48 -0
- data/test/command/suite/search/simple.test +22 -0
- data/test/command/suite/search/sort/default-offset-limit.expected +39 -0
- data/test/command/suite/search/sort/default-offset-limit.test +24 -0
- data/test/command/suite/search/sort/invisible-column.expected +24 -0
- data/test/command/suite/search/sort/invisible-column.test +26 -0
- data/test/command/suite/watch/subscribe.expected +6 -0
- data/test/command/suite/watch/subscribe.test +9 -0
- data/test/command/suite/watch/unsubscribe.expected +6 -0
- data/test/command/suite/watch/unsubscribe.test +9 -0
- data/test/performance/run-test.rb +56 -0
- data/test/performance/watch/catalog.json +33 -0
- data/test/performance/watch/feed.json +9 -0
- data/test/performance/watch/fluentd.conf +11 -0
- data/test/performance/watch/subscribe.json +3 -0
- data/test/unit/catalog/test_collection_volume.rb +103 -0
- data/test/unit/catalog/test_dataset.rb +104 -0
- data/test/unit/catalog/test_schema.rb +226 -0
- data/test/unit/catalog/test_single_volume.rb +31 -0
- data/test/unit/catalog/test_slice.rb +92 -0
- data/test/unit/catalog/test_version1.rb +361 -0
- data/test/unit/catalog/test_version2.rb +124 -0
- data/test/unit/catalog/test_version2_validator.rb +66 -0
- data/test/unit/catalog/test_volume_collection.rb +50 -0
- data/test/unit/fixtures/array.grn +18 -0
- data/test/unit/fixtures/catalog/version1.json +40 -0
- data/test/unit/fixtures/catalog/version2.json +62 -0
- data/test/unit/fixtures/document.grn +34 -0
- data/test/unit/fixtures/reference/array.grn +11 -0
- data/test/unit/fixtures/reference/hash.grn +7 -0
- data/test/unit/helper/distributed_search_planner_helper.rb +83 -0
- data/test/unit/helper/fixture.rb +28 -0
- data/test/unit/helper/plugin_helper.rb +38 -0
- data/test/unit/helper/sandbox.rb +86 -0
- data/test/unit/helper/stub_worker.rb +27 -0
- data/test/unit/helper/watch_helper.rb +23 -0
- data/test/unit/helper.rb +28 -0
- data/test/unit/plugins/crud/test_add.rb +190 -0
- data/test/unit/plugins/groonga/select/test_adapter_input.rb +510 -0
- data/test/unit/plugins/groonga/select/test_adapter_output.rb +201 -0
- data/test/unit/plugins/groonga/test_column_create.rb +171 -0
- data/test/unit/plugins/groonga/test_column_list.rb +170 -0
- data/test/unit/plugins/groonga/test_column_remove.rb +98 -0
- data/test/unit/plugins/groonga/test_column_rename.rb +105 -0
- data/test/unit/plugins/groonga/test_delete.rb +127 -0
- data/test/unit/plugins/groonga/test_table_create.rb +147 -0
- data/test/unit/plugins/groonga/test_table_list.rb +184 -0
- data/test/unit/plugins/groonga/test_table_remove.rb +61 -0
- data/test/unit/plugins/search/planner/test_basic.rb +120 -0
- data/test/unit/plugins/search/planner/test_group_by.rb +573 -0
- data/test/unit/plugins/search/planner/test_output.rb +388 -0
- data/test/unit/plugins/search/planner/test_sort_by.rb +938 -0
- data/test/unit/plugins/search/test_collector.rb +806 -0
- data/test/unit/plugins/search/test_handler.rb +930 -0
- data/test/unit/plugins/search/test_planner.rb +174 -0
- data/test/unit/plugins/test_basic.rb +510 -0
- data/test/unit/plugins/test_groonga.rb +70 -0
- data/test/unit/plugins/test_watch.rb +211 -0
- data/test/unit/run-test.rb +56 -0
- data/test/unit/test_catalog_generator.rb +93 -0
- data/test/unit/test_message_matcher.rb +160 -0
- data/test/unit/test_schema_applier.rb +59 -0
- data/test/unit/test_sweeper.rb +95 -0
- data/test/unit/test_watch_schema.rb +57 -0
- data/test/unit/test_watcher.rb +336 -0
- metadata +759 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
{
|
2
|
+
"datasets": {
|
3
|
+
"Droonga": {
|
4
|
+
"fact": "Memos",
|
5
|
+
"schema": {
|
6
|
+
"Memos": {
|
7
|
+
"type": "Hash",
|
8
|
+
"keyType": "ShortText",
|
9
|
+
"columns": {
|
10
|
+
"tags": {
|
11
|
+
"type": "Vector",
|
12
|
+
"valueType": "ShortText",
|
13
|
+
"vectorOptions": {
|
14
|
+
"weight": true
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
},
|
19
|
+
"Tags": {
|
20
|
+
"type": "Hash",
|
21
|
+
"keyType": "ShortText",
|
22
|
+
"columns": {
|
23
|
+
"memos_index": {
|
24
|
+
"type": "Index",
|
25
|
+
"valueType": "Memos",
|
26
|
+
"indexOptions": {
|
27
|
+
"sources": [
|
28
|
+
"tags"
|
29
|
+
],
|
30
|
+
"weight": true
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# -*- js -*-
|
2
|
+
#@require-catalog-version 2
|
3
|
+
#@disable-logging
|
4
|
+
{
|
5
|
+
"type": "add",
|
6
|
+
"dataset": "Droonga",
|
7
|
+
"body": {
|
8
|
+
"table": "Memos",
|
9
|
+
"key": "Droonga is fun.",
|
10
|
+
"values": {
|
11
|
+
"tags": [
|
12
|
+
{
|
13
|
+
"value": "droonga",
|
14
|
+
"weight": 9
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"value": "groonga",
|
18
|
+
"weight": 4
|
19
|
+
}
|
20
|
+
]
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
{
|
25
|
+
"type": "add",
|
26
|
+
"dataset": "Droonga",
|
27
|
+
"body": {
|
28
|
+
"table": "Memos",
|
29
|
+
"key": "Groonga is fast!",
|
30
|
+
"values": {
|
31
|
+
"tags": [
|
32
|
+
{
|
33
|
+
"value": "groonga",
|
34
|
+
"weight": 9
|
35
|
+
}
|
36
|
+
]
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
#@enable-logging
|
41
|
+
{
|
42
|
+
"type": "search",
|
43
|
+
"dataset": "Droonga",
|
44
|
+
"body": {
|
45
|
+
"queries": {
|
46
|
+
"memos": {
|
47
|
+
"source": "Memos",
|
48
|
+
"condition": "true",
|
49
|
+
"adjusters": [
|
50
|
+
{
|
51
|
+
"column": "tags",
|
52
|
+
"value": "droonga",
|
53
|
+
"factor": 5
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"column": "tags",
|
57
|
+
"value": "groonga",
|
58
|
+
"factor": 2
|
59
|
+
}
|
60
|
+
],
|
61
|
+
"sortBy": ["-_score"],
|
62
|
+
"output": {
|
63
|
+
"elements": [
|
64
|
+
"records"
|
65
|
+
],
|
66
|
+
"limit": 10,
|
67
|
+
"attributes": [
|
68
|
+
"_key",
|
69
|
+
"_score"
|
70
|
+
]
|
71
|
+
}
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
{
|
2
|
+
"datasets": {
|
3
|
+
"Droonga": {
|
4
|
+
"fact": "Memos",
|
5
|
+
"schema": {
|
6
|
+
"Memos": {
|
7
|
+
"type": "Hash",
|
8
|
+
"keyType": "ShortText",
|
9
|
+
"columns": {
|
10
|
+
"tags": {
|
11
|
+
"type": "Vector",
|
12
|
+
"valueType": "ShortText",
|
13
|
+
"vectorOptions": {
|
14
|
+
"weight": true
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
},
|
19
|
+
"Tags": {
|
20
|
+
"type": "Hash",
|
21
|
+
"keyType": "ShortText",
|
22
|
+
"columns": {
|
23
|
+
"memos_index": {
|
24
|
+
"type": "Index",
|
25
|
+
"valueType": "Memos",
|
26
|
+
"indexOptions": {
|
27
|
+
"sources": [
|
28
|
+
"tags"
|
29
|
+
],
|
30
|
+
"weight": true
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# -*- js -*-
|
2
|
+
#@require-catalog-version 2
|
3
|
+
#@disable-logging
|
4
|
+
{
|
5
|
+
"type": "add",
|
6
|
+
"dataset": "Droonga",
|
7
|
+
"body": {
|
8
|
+
"table": "Memos",
|
9
|
+
"key": "Droonga is fun.",
|
10
|
+
"values": {
|
11
|
+
"tags": [
|
12
|
+
{
|
13
|
+
"value": "droonga",
|
14
|
+
"weight": 9
|
15
|
+
}
|
16
|
+
]
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
{
|
21
|
+
"type": "add",
|
22
|
+
"dataset": "Droonga",
|
23
|
+
"body": {
|
24
|
+
"table": "Memos",
|
25
|
+
"key": "Groonga is fast!",
|
26
|
+
"values": {
|
27
|
+
"tags": [
|
28
|
+
{
|
29
|
+
"value": "groonga",
|
30
|
+
"weight": 9
|
31
|
+
}
|
32
|
+
]
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
#@enable-logging
|
37
|
+
{
|
38
|
+
"type": "search",
|
39
|
+
"dataset": "Droonga",
|
40
|
+
"body": {
|
41
|
+
"queries": {
|
42
|
+
"memos": {
|
43
|
+
"source": "Memos",
|
44
|
+
"condition": "true",
|
45
|
+
"adjusters": [
|
46
|
+
{
|
47
|
+
"column": "tags",
|
48
|
+
"value": "droonga",
|
49
|
+
"factor": 5
|
50
|
+
}
|
51
|
+
],
|
52
|
+
"sortBy": ["-_score"],
|
53
|
+
"output": {
|
54
|
+
"elements": [
|
55
|
+
"records"
|
56
|
+
],
|
57
|
+
"limit": 10,
|
58
|
+
"attributes": [
|
59
|
+
"_key",
|
60
|
+
"_score"
|
61
|
+
]
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"statusCode": 200,
|
4
|
+
"type": "search.result",
|
5
|
+
"body": {
|
6
|
+
"result": {
|
7
|
+
"count": 9,
|
8
|
+
"records": [
|
9
|
+
{
|
10
|
+
"section-id": "1.1"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"section-id": "1.2"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"section-id": "1.3"
|
17
|
+
}
|
18
|
+
]
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#@include fixture/documents.jsons
|
2
|
+
{
|
3
|
+
"type": "search",
|
4
|
+
"dataset": "Droonga",
|
5
|
+
"body": {
|
6
|
+
"queries": {
|
7
|
+
"result": {
|
8
|
+
"source": "Sections",
|
9
|
+
"sortBy": ["_key"],
|
10
|
+
"output": {
|
11
|
+
"elements": [
|
12
|
+
"count",
|
13
|
+
"attributes",
|
14
|
+
"records"
|
15
|
+
],
|
16
|
+
"format": "complex",
|
17
|
+
"limit": 3,
|
18
|
+
"attributes": [
|
19
|
+
{
|
20
|
+
"label": "section-id",
|
21
|
+
"source": "_key"
|
22
|
+
}
|
23
|
+
]
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"statusCode": 200,
|
4
|
+
"type": "search.result",
|
5
|
+
"body": {
|
6
|
+
"result": {
|
7
|
+
"count": 9,
|
8
|
+
"records": [
|
9
|
+
{
|
10
|
+
"section-id": "1.1",
|
11
|
+
"label": "Groonga overview",
|
12
|
+
"fixed-number": 29,
|
13
|
+
"fixed-string": "Groonga"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"section-id": "1.2",
|
17
|
+
"label": "Full text search and Instant update",
|
18
|
+
"fixed-number": 29,
|
19
|
+
"fixed-string": "Groonga"
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"section-id": "1.3",
|
23
|
+
"label": "Column store and aggregate query",
|
24
|
+
"fixed-number": 29,
|
25
|
+
"fixed-string": "Groonga"
|
26
|
+
}
|
27
|
+
]
|
28
|
+
}
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
#@include fixture/documents.jsons
|
2
|
+
{
|
3
|
+
"type": "search",
|
4
|
+
"dataset": "Droonga",
|
5
|
+
"body": {
|
6
|
+
"queries": {
|
7
|
+
"result": {
|
8
|
+
"source": "Sections",
|
9
|
+
"sortBy": ["_key"],
|
10
|
+
"output": {
|
11
|
+
"elements": [
|
12
|
+
"count",
|
13
|
+
"attributes",
|
14
|
+
"records"
|
15
|
+
],
|
16
|
+
"format": "complex",
|
17
|
+
"limit": 3,
|
18
|
+
"attributes": {
|
19
|
+
"section-id": {
|
20
|
+
"source": "_key"
|
21
|
+
},
|
22
|
+
"label": {
|
23
|
+
"source": "title"
|
24
|
+
},
|
25
|
+
"fixed-number": {
|
26
|
+
"source": "29"
|
27
|
+
},
|
28
|
+
"fixed-string": {
|
29
|
+
"source": "\"Groonga\""
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"statusCode": 200,
|
4
|
+
"type": "search.result",
|
5
|
+
"body": {
|
6
|
+
"result": {
|
7
|
+
"count": 9,
|
8
|
+
"records": [
|
9
|
+
{
|
10
|
+
"_key": "1.1",
|
11
|
+
"title": "Groonga overview"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"_key": "1.2",
|
15
|
+
"title": "Full text search and Instant update"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"_key": "1.3",
|
19
|
+
"title": "Column store and aggregate query"
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"_key": "1.4",
|
23
|
+
"title": "Inverted index and tokenizer"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"_key": "1.5",
|
27
|
+
"title": "Sharable storage and read lock-free"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"_key": "1.6",
|
31
|
+
"title": "Geo-location (latitude and longitude) search"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"_key": "1.7",
|
35
|
+
"title": "Groonga library"
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"_key": "1.8",
|
39
|
+
"title": "Groonga server"
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"_key": "1.9",
|
43
|
+
"title": "Groonga storage engine"
|
44
|
+
}
|
45
|
+
]
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#@include fixture/documents.jsons
|
2
|
+
{
|
3
|
+
"type": "search",
|
4
|
+
"dataset": "Droonga",
|
5
|
+
"body": {
|
6
|
+
"queries": {
|
7
|
+
"result": {
|
8
|
+
"source": "Sections",
|
9
|
+
"sortBy": ["_key"],
|
10
|
+
"output": {
|
11
|
+
"elements": [
|
12
|
+
"count",
|
13
|
+
"attributes",
|
14
|
+
"records"
|
15
|
+
],
|
16
|
+
"format": "complex",
|
17
|
+
"limit": -1,
|
18
|
+
"attributes": ["_key", "title"]
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#@include fixture/documents.jsons
|
2
|
+
{
|
3
|
+
"type": "search",
|
4
|
+
"dataset": "Droonga",
|
5
|
+
"body": {
|
6
|
+
"queries": {
|
7
|
+
"result": {
|
8
|
+
"source": "Sections",
|
9
|
+
"condition": [
|
10
|
+
"&&",
|
11
|
+
"title @ 'groonga'",
|
12
|
+
"title @ 'engine'"
|
13
|
+
],
|
14
|
+
"sortBy": ["_key"],
|
15
|
+
"output": {
|
16
|
+
"elements": [
|
17
|
+
"count",
|
18
|
+
"attributes",
|
19
|
+
"records"
|
20
|
+
],
|
21
|
+
"limit": -1,
|
22
|
+
"attributes": ["title"]
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{
|
2
|
+
"datasets": {
|
3
|
+
"Droonga": {
|
4
|
+
"fact": "Memos",
|
5
|
+
"schema": {
|
6
|
+
"Memos": {
|
7
|
+
"type": "Hash",
|
8
|
+
"keyType": "ShortText",
|
9
|
+
"columns": {
|
10
|
+
"content": {
|
11
|
+
"type": "Scalar",
|
12
|
+
"valueType": "Text"
|
13
|
+
}
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"Terms": {
|
17
|
+
"type": "PatriciaTrie",
|
18
|
+
"keyType": "ShortText",
|
19
|
+
"tokenizer": "TokenBigram",
|
20
|
+
"normalizer": "NormalizerAuto",
|
21
|
+
"columns": {
|
22
|
+
"memos_index": {
|
23
|
+
"type": "Index",
|
24
|
+
"valueType": "Memos",
|
25
|
+
"indexOptions": {
|
26
|
+
"sources": [
|
27
|
+
"content"
|
28
|
+
]
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
{
|
2
|
+
"inReplyTo": "request-id",
|
3
|
+
"statusCode": 400,
|
4
|
+
"type": "search.result",
|
5
|
+
"body": {
|
6
|
+
"name": "SyntaxError",
|
7
|
+
"message": "Syntax error: syntax:<query> input:<nonexistent:Droonga>",
|
8
|
+
"detail": {
|
9
|
+
"syntax": "query",
|
10
|
+
"input": "nonexistent:Droonga"
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"errors": {
|
14
|
+
"sources0": {
|
15
|
+
"statusCode": 400,
|
16
|
+
"body": {
|
17
|
+
"name": "SyntaxError",
|
18
|
+
"message": "Syntax error: syntax:<query> input:<nonexistent:Droonga>",
|
19
|
+
"detail": {
|
20
|
+
"syntax": "query",
|
21
|
+
"input": "nonexistent:Droonga"
|
22
|
+
}
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"sources1": {
|
26
|
+
"statusCode": 400,
|
27
|
+
"body": {
|
28
|
+
"name": "SyntaxError",
|
29
|
+
"message": "Syntax error: syntax:<query> input:<nonexistent:Droonga>",
|
30
|
+
"detail": {
|
31
|
+
"syntax": "query",
|
32
|
+
"input": "nonexistent:Droonga"
|
33
|
+
}
|
34
|
+
}
|
35
|
+
},
|
36
|
+
"sources2": {
|
37
|
+
"statusCode": 400,
|
38
|
+
"body": {
|
39
|
+
"name": "SyntaxError",
|
40
|
+
"message": "Syntax error: syntax:<query> input:<nonexistent:Droonga>",
|
41
|
+
"detail": {
|
42
|
+
"syntax": "query",
|
43
|
+
"input": "nonexistent:Droonga"
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# -*- js -*-
|
2
|
+
#@require-catalog-version 2
|
3
|
+
#@disable-logging
|
4
|
+
{
|
5
|
+
"type": "add",
|
6
|
+
"dataset": "Droonga",
|
7
|
+
"body": {
|
8
|
+
"table": "Memos",
|
9
|
+
"key": "droonga",
|
10
|
+
"values": {
|
11
|
+
"content": "Droonga is fun!"
|
12
|
+
}
|
13
|
+
}
|
14
|
+
}
|
15
|
+
#@enable-logging
|
16
|
+
{
|
17
|
+
"type": "search",
|
18
|
+
"dataset": "Droonga",
|
19
|
+
"body": {
|
20
|
+
"queries": {
|
21
|
+
"memos": {
|
22
|
+
"source": "Memos",
|
23
|
+
"condition": {
|
24
|
+
"matchTo": ["content"],
|
25
|
+
"query": "nonexistent:Droonga"
|
26
|
+
},
|
27
|
+
"output": {
|
28
|
+
"elements": ["count"]
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
{
|
2
|
+
"datasets": {
|
3
|
+
"Droonga": {
|
4
|
+
"fact": "Memos",
|
5
|
+
"schema": {
|
6
|
+
"Memos": {
|
7
|
+
"type": "Hash",
|
8
|
+
"keyType": "ShortText",
|
9
|
+
"columns": {
|
10
|
+
"content": {
|
11
|
+
"type": "Scalar",
|
12
|
+
"valueType": "Text"
|
13
|
+
}
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"Terms": {
|
17
|
+
"type": "PatriciaTrie",
|
18
|
+
"keyType": "ShortText",
|
19
|
+
"tokenizer": "TokenBigram",
|
20
|
+
"normalizer": "NormalizerAuto",
|
21
|
+
"columns": {
|
22
|
+
"memos_index": {
|
23
|
+
"type": "Index",
|
24
|
+
"valueType": "Memos",
|
25
|
+
"indexOptions": {
|
26
|
+
"sources": [
|
27
|
+
"content"
|
28
|
+
]
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|