Alex D created SOLR-9356:
----------------------------

             Summary: Highlight component added using Config API is not 
functional
                 Key: SOLR-9356
                 URL: https://issues.apache.org/jira/browse/SOLR-9356
             Project: Solr
          Issue Type: Sub-task
          Components: highlighter
    Affects Versions: 6.0.1
         Environment: SolrCloud on Windows with ZooKeeper 3.4.8
            Reporter: Alex D


The configuration of a highlight component is not used when the component is 
added using the Config API. I used the following steps to reproduce the issue:

1) Add the highlight component on a request handler:
                <str name="hl">on</str>
                <str name="hl.fl">Email</str>
                <str name="f.name.hl.fragsize">0</str>

2) Execute a search using the request handler.  I can see the default 
configuration of the component returned in the results:
    "highlighting":{"a":{"Email":["<em>roger2</em>"]},"b":{ 
"Email":"<em>roger</em>"]}

3) Add the highlight component using the Config API (see JSON below) & reload 
collection.  No errors were returned by Solr when adding the component.

4) Execute the same search as step2 and we can see the format of the highlight 
is still using "em" instead of the new format from the Config API.




Content of the post to the Config API:
(Curl in a Windows' command prompt has some issues parsing the JSON so I used 
Fiddler to send it to Solr)

{
   "add-searchcomponent":{
      "name":"highlight",
      "class":"solr.HighlightComponent",
      "":{
         "gap":{
            "default":"true",
            "name":"gap",
            "class":"solr.highlight.GapFragmenter",
            "defaults":{
               "hl.fragsize":100
            }
         },
         "regex":{
            "name":"regex",
            "class":"solr.highlight.RegexFragmenter",
            "defaults":{
               "hl.fragsize":70,
               "hl.regex.slop":0.5,
               "hl.regex.pattern":"[-\\w ,/\\n\\\"']{20,200}"
            }
         },
         "html":[
            {
               "default":"true",
               "name":"html",
               "class":"solr.highlight.HtmlFormatter",
               "defaults":{
                  "hl.simple.pre":"pre-",
                  "hl.simple.post":"-post"
               }
            },
            {
               "name":"html",
               "class":"solr.highlight.HtmlEncoder"
            }
         ],
         "simple":{
            "name":"simple",
            "class":"solr.highlight.SimpleFragListBuilder"
         },
         "single":{
            "name":"single",
            "class":"solr.highlight.SingleFragListBuilder"
         },
         "weighted":{
            "default":"true",
            "name":"weighted",
            "class":"solr.highlight.WeightedFragListBuilder"
         },
         "default":[
            {
               "default":"true",
               "name":"default",
               "class":"solr.highlight.ScoreOrderFragmentsBuilder"
            },
            {
               "default":"true",
               "name":"default",
               "class":"solr.highlight.SimpleBoundaryScanner",
               "defaults":{
                  "hl.bs.maxScan":"10",
                  "hl.bs.chars":".,!? \t\n\r"
               }
            }
         ],
         "colored":{
            "name":"colored",
            "class":"solr.highlight.ScoreOrderFragmentsBuilder",
            "defaults":{
               "hl.tag.pre":"pre-",
               "hl.tag.post":"-post"
            }
         },
         "breakIterator":{
            "name":"breakIterator",
            "class":"solr.highlight.BreakIteratorBoundaryScanner",
            "defaults":{
               "hl.bs.type":"WORD",
               "hl.bs.language":"en",
               "hl.bs.country":"US"
            }
         }
      }
   }
}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to