[Groonga-commit] groonga/groonga at 1a685d8 [master] highlight_html test: add a test for phrase case

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Jun 7 14:11:31 JST 2018


Kouhei Sutou	2018-06-07 14:11:31 +0900 (Thu, 07 Jun 2018)

  New Revision: 1a685d824b74827b8dd35bef83e94d03db3b1461
  https://github.com/groonga/groonga/commit/1a685d824b74827b8dd35bef83e94d03db3b1461

  Message:
    highlight_html test: add a test for phrase case

  Added files:
    test/command/suite/select/function/highlight_html/lexicon/phrase.expected
    test/command/suite/select/function/highlight_html/lexicon/phrase.test

  Added: test/command/suite/select/function/highlight_html/lexicon/phrase.expected (+37 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/function/highlight_html/lexicon/phrase.expected    2018-06-07 14:11:31 +0900 (86aa4837a)
@@ -0,0 +1,37 @@
+table_create Entries TABLE_NO_KEY
+[[0,0.0,0.0],true]
+column_create Entries body COLUMN_SCALAR ShortText
+[[0,0.0,0.0],true]
+table_create Terms TABLE_PAT_KEY ShortText   --default_tokenizer 'TokenNgram("report_source_location", true)'   --normalizer 'NormalizerNFKC100'
+[[0,0.0,0.0],true]
+column_create Terms document_index COLUMN_INDEX|WITH_POSITION Entries body
+[[0,0.0,0.0],true]
+load --table Entries
+[
+{"body": "one two three four five six"}
+]
+[[0,0.0,0.0],1]
+select Entries   --match_columns body   --query '"two three" OR five'   --output_columns 'highlight_html(body, Terms)'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        1
+      ],
+      [
+        [
+          "highlight_html",
+          null
+        ]
+      ],
+      [
+        "one<span class=\"keyword\"> two three</span> four<span class=\"keyword\"> five</span> six"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/function/highlight_html/lexicon/phrase.test (+17 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/function/highlight_html/lexicon/phrase.test    2018-06-07 14:11:31 +0900 (178a8ba99)
@@ -0,0 +1,17 @@
+table_create Entries TABLE_NO_KEY
+column_create Entries body COLUMN_SCALAR ShortText
+
+table_create Terms TABLE_PAT_KEY ShortText \
+  --default_tokenizer 'TokenNgram("report_source_location", true)' \
+  --normalizer 'NormalizerNFKC100'
+column_create Terms document_index COLUMN_INDEX|WITH_POSITION Entries body
+
+load --table Entries
+[
+{"body": "one two three four five six"}
+]
+
+select Entries \
+  --match_columns body \
+  --query '"two three" OR five' \
+  --output_columns 'highlight_html(body, Terms)'
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180607/6c55b4b1/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index