forked from groonga/groonga
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It uses the full-spec on the snippet API.
- Loading branch information
Showing
33 changed files
with
1,226 additions
and
0 deletions.
There are no files selected for viewing
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
53 changes: 53 additions & 0 deletions
53
test/command/suite/select/function/snippet_full/html_escape_off.expected
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| table_create Entries TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Entries title COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Entries content COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| [[0,0.0,0.0],true] | ||
| column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title | ||
| [[0,0.0,0.0],true] | ||
| column_create Tokens entries_content COLUMN_INDEX|WITH_POSITION Entries content | ||
| [[0,0.0,0.0],true] | ||
| load --table Entries | ||
| [ | ||
| {"title": "<p>groonga and MySQL</p>", "content": "groonga + MySQL = mroonga."} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Entries --output_columns 'title, snippet_full(title, 200, 2, "NormalizerAuto", 1, 0, "...", "...", "groonga", "<span class=\\"w1\\">", "</span>", "MySQL", "<span class=\\"w2\\">", "</span>"), content' --command_version 2 --match_columns 'title' --query groonga | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "title", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "snippet_full", | ||
| "null" | ||
| ], | ||
| [ | ||
| "content", | ||
| "ShortText" | ||
| ] | ||
| ], | ||
| [ | ||
| "<p>groonga and MySQL</p>", | ||
| [ | ||
| "...<p><span class=\"w1\">groonga</span> and <span class=\"w2\">MySQL</span></p>..." | ||
| ], | ||
| "groonga + MySQL = mroonga." | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
19 changes: 19 additions & 0 deletions
19
test/command/suite/select/function/snippet_full/html_escape_off.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| table_create Entries TABLE_NO_KEY | ||
| column_create Entries title COLUMN_SCALAR ShortText | ||
| column_create Entries content COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title | ||
| column_create Tokens entries_content COLUMN_INDEX|WITH_POSITION Entries content | ||
|
|
||
| load --table Entries | ||
| [ | ||
| {"title": "<p>groonga and MySQL</p>", "content": "groonga + MySQL = mroonga."} | ||
| ] | ||
|
|
||
| select Entries \ | ||
| --output_columns 'title, snippet_full(title, 200, 2, "NormalizerAuto", 1, 0, "...", "...", \ | ||
| "groonga", "<span class=\\"w1\\">", "</span>", "MySQL", "<span class=\\"w2\\">", "</span>"), content' \ | ||
| --command_version 2 \ | ||
| --match_columns 'title' \ | ||
| --query groonga |
53 changes: 53 additions & 0 deletions
53
test/command/suite/select/function/snippet_full/html_escape_on.expected
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| table_create Entries TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Entries title COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Entries content COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| [[0,0.0,0.0],true] | ||
| column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title | ||
| [[0,0.0,0.0],true] | ||
| column_create Tokens entries_content COLUMN_INDEX|WITH_POSITION Entries content | ||
| [[0,0.0,0.0],true] | ||
| load --table Entries | ||
| [ | ||
| {"title": "<p>groonga and MySQL</p>", "content": "groonga + MySQL = mroonga."} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Entries --output_columns 'title, snippet_full(title, 200, 2, "NormalizerAuto", 1, 1, "...", "...", "groonga", "<span class=\\"w1\\">", "</span>", "MySQL", "<span class=\\"w2\\">", "</span>"), content' --command_version 2 --match_columns 'title' --query groonga | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "title", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "snippet_full", | ||
| "null" | ||
| ], | ||
| [ | ||
| "content", | ||
| "ShortText" | ||
| ] | ||
| ], | ||
| [ | ||
| "<p>groonga and MySQL</p>", | ||
| [ | ||
| "...<p><span class=\"w1\">groonga</span> and <span class=\"w2\">MySQL</span></p>..." | ||
| ], | ||
| "groonga + MySQL = mroonga." | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
19 changes: 19 additions & 0 deletions
19
test/command/suite/select/function/snippet_full/html_escape_on.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| table_create Entries TABLE_NO_KEY | ||
| column_create Entries title COLUMN_SCALAR ShortText | ||
| column_create Entries content COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title | ||
| column_create Tokens entries_content COLUMN_INDEX|WITH_POSITION Entries content | ||
|
|
||
| load --table Entries | ||
| [ | ||
| {"title": "<p>groonga and MySQL</p>", "content": "groonga + MySQL = mroonga."} | ||
| ] | ||
|
|
||
| select Entries \ | ||
| --output_columns 'title, snippet_full(title, 200, 2, "NormalizerAuto", 1, 1, "...", "...", \ | ||
| "groonga", "<span class=\\"w1\\">", "</span>", "MySQL", "<span class=\\"w2\\">", "</span>"), content' \ | ||
| --command_version 2 \ | ||
| --match_columns 'title' \ | ||
| --query groonga |
53 changes: 53 additions & 0 deletions
53
test/command/suite/select/function/snippet_full/leading_space_off.expected
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| table_create Entries TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Entries title COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Entries content COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| [[0,0.0,0.0],true] | ||
| column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title | ||
| [[0,0.0,0.0],true] | ||
| column_create Tokens entries_content COLUMN_INDEX|WITH_POSITION Entries content | ||
| [[0,0.0,0.0],true] | ||
| load --table Entries | ||
| [ | ||
| {"title": "groonga and MySQL", "content": "groonga + MySQL = mroonga."} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Entries --output_columns 'title, snippet_full(title, 200, 2, "NormalizerAuto", 0, 1, "...", "...", "groonga", "<span class=\\"w1\\">", "</span>", "MySQL", "<span class=\\"w2\\">", "</span>"), content' --command_version 2 --match_columns 'title' --query groonga | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "title", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "snippet_full", | ||
| "null" | ||
| ], | ||
| [ | ||
| "content", | ||
| "ShortText" | ||
| ] | ||
| ], | ||
| [ | ||
| "groonga and MySQL", | ||
| [ | ||
| "...<span class=\"w1\">groonga</span> and<span class=\"w2\"> MySQL</span>..." | ||
| ], | ||
| "groonga + MySQL = mroonga." | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
19 changes: 19 additions & 0 deletions
19
test/command/suite/select/function/snippet_full/leading_space_off.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| table_create Entries TABLE_NO_KEY | ||
| column_create Entries title COLUMN_SCALAR ShortText | ||
| column_create Entries content COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title | ||
| column_create Tokens entries_content COLUMN_INDEX|WITH_POSITION Entries content | ||
|
|
||
| load --table Entries | ||
| [ | ||
| {"title": "groonga and MySQL", "content": "groonga + MySQL = mroonga."} | ||
| ] | ||
|
|
||
| select Entries \ | ||
| --output_columns 'title, snippet_full(title, 200, 2, "NormalizerAuto", 0, 1, "...", "...", \ | ||
| "groonga", "<span class=\\"w1\\">", "</span>", "MySQL", "<span class=\\"w2\\">", "</span>"), content' \ | ||
| --command_version 2 \ | ||
| --match_columns 'title' \ | ||
| --query groonga |
53 changes: 53 additions & 0 deletions
53
test/command/suite/select/function/snippet_full/leading_space_on.expected
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| table_create Entries TABLE_NO_KEY | ||
| [[0,0.0,0.0],true] | ||
| column_create Entries title COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| column_create Entries content COLUMN_SCALAR ShortText | ||
| [[0,0.0,0.0],true] | ||
| table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| [[0,0.0,0.0],true] | ||
| column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title | ||
| [[0,0.0,0.0],true] | ||
| column_create Tokens entries_content COLUMN_INDEX|WITH_POSITION Entries content | ||
| [[0,0.0,0.0],true] | ||
| load --table Entries | ||
| [ | ||
| {"title": "groonga and MySQL", "content": "groonga + MySQL = mroonga."} | ||
| ] | ||
| [[0,0.0,0.0],1] | ||
| select Entries --output_columns 'title, snippet_full(title, 200, 2, "NormalizerAuto", 1, 1, "...", "...", "groonga", "<span class=\\"w1\\">", "</span>", "MySQL", "<span class=\\"w2\\">", "</span>"), content' --command_version 2 --match_columns 'title' --query groonga | ||
| [ | ||
| [ | ||
| 0, | ||
| 0.0, | ||
| 0.0 | ||
| ], | ||
| [ | ||
| [ | ||
| [ | ||
| 1 | ||
| ], | ||
| [ | ||
| [ | ||
| "title", | ||
| "ShortText" | ||
| ], | ||
| [ | ||
| "snippet_full", | ||
| "null" | ||
| ], | ||
| [ | ||
| "content", | ||
| "ShortText" | ||
| ] | ||
| ], | ||
| [ | ||
| "groonga and MySQL", | ||
| [ | ||
| "...<span class=\"w1\">groonga</span> and <span class=\"w2\">MySQL</span>..." | ||
| ], | ||
| "groonga + MySQL = mroonga." | ||
| ] | ||
| ] | ||
| ] | ||
| ] |
19 changes: 19 additions & 0 deletions
19
test/command/suite/select/function/snippet_full/leading_space_on.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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| table_create Entries TABLE_NO_KEY | ||
| column_create Entries title COLUMN_SCALAR ShortText | ||
| column_create Entries content COLUMN_SCALAR ShortText | ||
|
|
||
| table_create Tokens TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram | ||
| column_create Tokens entries_title COLUMN_INDEX|WITH_POSITION Entries title | ||
| column_create Tokens entries_content COLUMN_INDEX|WITH_POSITION Entries content | ||
|
|
||
| load --table Entries | ||
| [ | ||
| {"title": "groonga and MySQL", "content": "groonga + MySQL = mroonga."} | ||
| ] | ||
|
|
||
| select Entries \ | ||
| --output_columns 'title, snippet_full(title, 200, 2, "NormalizerAuto", 1, 1, "...", "...", \ | ||
| "groonga", "<span class=\\"w1\\">", "</span>", "MySQL", "<span class=\\"w2\\">", "</span>"), content' \ | ||
| --command_version 2 \ | ||
| --match_columns 'title' \ | ||
| --query groonga |
Oops, something went wrong.