[ https://issues.apache.org/jira/browse/SOLR-11801?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christine Poerschke updated SOLR-11801: --------------------------------------- Attachment: SOLR-11801.patch support customisation of the "highlighting" query response element (Ramsey Haddad, Pranav Murugappan, Christine Poerschke) ---- The attached patch meets the objective but we would welcome feedback and input, generally and specifically on the following points: * CustomHighlightComponentTest extending AbstractFullDistribZkTestBase seems a little heavy. To do/Yet to explore extending SolrCloudTestCase instead whilst still using the Config API, similar to TestReqParamsAPI. * [~dsmiley], you as part of SOLR-9708 deprecated some code portions and [mentioned|https://github.com/apache/lucene-solr/blob/releases/lucene-solr/7.2.0/solr/core/src/java/org/apache/solr/handler/component/HighlightComponent.java#L86] about future restructuring. It seems the changes proposed here would not interfere with such plans, do you agree? * Instead of refactoring the code as attached to allow customisation, might there be scope for and/or value in formally exposing the alternative "highlighting" query response element e.g. via a new {{hl.collator}} parameter (similar to JSON Response Writer's [json.nl parameter|https://lucene.apache.org/solr/guide/7_2/response-writers.html#json-nl]) e.g. ** {{hl.collator=mapmap}} - the default corresponding to current/existing behaviour, and ** {{hl.collator=arrmap}} - the alternative format as in the patch's test component, and ** (potentially in future) {{hl.collator=arrarr}} - avoiding use of the "manu" field as a key in the snippets map, i.e. {code} { ... "highlighting" : [ { "id" : "MA147LL/A", "highlights" : [ { "field" : "manu", "snippets" : [ "<em>Apple</em> Computer Inc." ] } ] } ] } {code} > support customisation of the "highlighting" query response element > ------------------------------------------------------------------ > > Key: SOLR-11801 > URL: https://issues.apache.org/jira/browse/SOLR-11801 > Project: Solr > Issue Type: New Feature > Components: highlighter > Reporter: Christine Poerschke > Assignee: Christine Poerschke > Priority: Minor > Attachments: SOLR-11801.patch > > > The objective and use case behind the proposed changes is to be able to > receive not the out-of-the-box highlighting map > {code} > { > ... > "highlighting" : { > "MA147LL/A" : { > "manu" : [ > "<em>Apple</em> Computer Inc." > ] > } > } > } > {code} > as illustrated in > https://lucene.apache.org/solr/guide/7_2/highlighting.html#highlighting-in-the-query-response > but to be able to customise the highlighting element of the query response > to (for example) be like this > {code} > { > ... > "highlighting" : [ > { > "id" : "MA147LL/A", > "snippets" : { > "manu" : [ > "<em>Apple</em> Computer Inc." > ] > } > } > ] > } > {code} > where the highlighting element itself is a list and where the keys of each > list element are 'knowable' in advance i.e. they are not 'unknowable' > document ids. -- This message was sent by Atlassian JIRA (v6.4.14#64029) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org