Improve comments on fields and fix opening_text - needs no highlights.
authorStanislav Malyshev <smalyshev@gmail.com>
Fri, 8 Jul 2016 18:52:55 +0000 (11:52 -0700)
committerStanislav Malyshev <smalyshev@gmail.com>
Fri, 8 Jul 2016 20:02:06 +0000 (13:02 -0700)
Change-Id: Iad6876aae109ad84c5534619f47c72edc900d704

includes/content/WikitextContentHandler.php
includes/search/SearchIndexField.php

index 86f0d50..4e8f0df 100644 (file)
@@ -127,7 +127,8 @@ class WikitextContentHandler extends TextContentHandler {
 
                $fields['opening_text'] =
                        $engine->makeSearchFieldMapping( 'opening_text', SearchIndexField::INDEX_TYPE_TEXT );
-               $fields['opening_text']->setFlag( SearchIndexField::FLAG_SCORING );
+               $fields['opening_text']->setFlag( SearchIndexField::FLAG_SCORING |
+                                                 SearchIndexField::FLAG_NO_HIGHLIGHT );
 
                $fields['outgoing_link'] =
                        $engine->makeSearchFieldMapping( 'outgoing_link', SearchIndexField::INDEX_TYPE_KEYWORD );
index 2ea255f..7499853 100644 (file)
@@ -22,7 +22,9 @@ interface SearchIndexField {
         */
        const FLAG_CASEFOLD = 1;
        /**
-        * This field is for scoring only.
+        * This field contains secondary information, which is
+        * already present in other fields, but can be used for
+        * scoring.
         */
        const FLAG_SCORING = 2;
        /**
@@ -30,7 +32,7 @@ interface SearchIndexField {
         */
        const FLAG_NO_HIGHLIGHT = 4;
        /**
-        * Do not index this field.
+        * Do not index this field, just store it.
         */
        const FLAG_NO_INDEX = 8;
        /**