[
https://issues.apache.org/jira/browse/SOLR-9356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15402244#comment-15402244
]
David Smiley commented on SOLR-9356:
------------------------------------
BTW, not strictly related to this problem you seem to have found but, any way,
I think it was a mistake for the {{SolrHighlighter}} to exist as a separate
abstraction from simply making {{HighlightComponent}} extensible (i.e. be a
base class). I don't see the point of the decoupling and having a separate
{{<highlighting>}} area. SearchComponents are configurable, even though most
were not written to use the child NamedList/config. ClusteringComponent is a
good example of doing it right IMO.
> 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: config-api, 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]