[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-28 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Attachment: SOLR-8583.patch

bq. You could move this line (that already existed) higher up so that you 
needn't re-pull it out in the highlighting alternate code
Done

bq. why the max(18,altFieldLen) ? 18 seems like a magic number
FVH requires FRAGSIZE to be at least 18, else there will be an exception. So I 
just set that as the lower limit. Added a comment line in the code: {code}// 
Enforce maxAlternateFieldLength by FRAGSIZE. Minimum 18 due to FVH limitations
{code}

Also added [~dsmiley] as contributor in CHANGES, thanks for all the feedback!

Will go ahead and commit latest patch now.

> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
>  Labels: fallback, highlighter
> Fix For: 6.1, master (7.0)
>
> Attachments: SOLR-8583.patch, SOLR-8583.patch, SOLR-8583.patch, 
> SOLR-8583.patch, SOLR-8583.patch, SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> This issue will cause alternate field to be highlighted with no snippet 
> generation, and still respect max length. You can turn it off using new param 
> {{hl.highlightAlternate=false}}. Supported highlighters: Simple, FVH



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-27 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Labels: fallback highlighter  (was: )

> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
>  Labels: fallback, highlighter
> Fix For: 6.1, master (7.0)
>
> Attachments: SOLR-8583.patch, SOLR-8583.patch, SOLR-8583.patch, 
> SOLR-8583.patch, SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> This issue will cause alternate field to be highlighted with no snippet 
> generation, and still respect max length. You can turn it off using new param 
> {{hl.highlightAlternate=false}}. Supported highlighters: Simple, FVH



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-27 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Fix Version/s: master (7.0)

> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
> Fix For: 6.1, master (7.0)
>
> Attachments: SOLR-8583.patch, SOLR-8583.patch, SOLR-8583.patch, 
> SOLR-8583.patch, SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> This issue will cause alternate field to be highlighted with no snippet 
> generation, and still respect max length. You can turn it off using new param 
> {{hl.highlightAlternate=false}}. Supported highlighters: Simple, FVH



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-27 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Attachment: SOLR-8583.patch

New patch incorporating Davids comments:
* Changed order of params for {{doHighlightingOfField()}} and 
{{alternateField()}}
* Added test for {{hl.requireFieldMatch=true}}
* Added test that proves that we get highlighting of fallback field even if 
there was no match in the field when {{hl.requireFieldMatch=false}}

To me it looks like the requireFieldMatch works as expected, at least with the 
default highlighter, so I have not changed any logic. Since it behaves exactly 
the same way for alternate field as for the main highlight field I'm not sure 
if we need to document anything here either.

Think this is getting close to committable?

> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
> Fix For: 6.1
>
> Attachments: SOLR-8583.patch, SOLR-8583.patch, SOLR-8583.patch, 
> SOLR-8583.patch, SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> This issue will cause alternate field to be highlighted with no snippet 
> generation, and still respect max length. You can turn it off using new param 
> {{hl.highlightAlternate=false}}. Supported highlighters: Simple, FVH



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-26 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Attachment: SOLR-8583.patch

The reason for difference in length is probably in how the fragmenters work. 
Tried out some more sizes and it changes, although not at the limits I expected 
for Simple highlighter.

Here's a new patch using only {{FRAGSIZE}} in limiting maxAlternateFieldLength, 
instead of also using {{MAX_CHARS}}, as it did not add any value.

> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
> Fix For: 6.1
>
> Attachments: SOLR-8583.patch, SOLR-8583.patch, SOLR-8583.patch, 
> SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> This issue will cause alternate field to be highlighted with no snippet 
> generation, and still respect max length. You can turn it off using new param 
> {{hl.highlightAlternate=false}}. Supported highlighters: Simple, FVH



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-26 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Attachment: SOLR-8583.patch

New patch incorporating [~dsmiley]'s comments more or less:

* Went back to swapping {{req.params}} with a wrapDefaults version.
* New method {{doHighlightingOfField()}} which gets rid of duplication of code
* Lazy FVH init by passing around new inner class FvhContainer with members 
{{fvh}} and {{fieldQuery}} which can then be altered by methods
* Moved highlighting of alternate into method {{alternateField()}} to gather 
all logic in same place
* FIeldname loop now looks like this: {code}// Highlight per-field
for (String fieldName : fieldNames) {
  SchemaField schemaField = schema.getFieldOrNull(fieldName);

  Object fieldHighlights; // object type allows flexibility for subclassers
  fieldHighlights = doHighlightingOfField(schemaField, params, fvhContainer, 
doc, docId, query, reader, req);

  if (fieldHighlights == null) {
fieldHighlights = alternateField(doc, fieldName, req, docId, query, reader, 
schema, fvhContainer);
  }

  if (fieldHighlights != null) {
docHighlights.add(fieldName, fieldHighlights);
  }
} // for each field
{code}

What puzzles me is that the changes should be pure code structure, no 
functionality change, yet one of the tests started failing. It was the first 
test of {{testAlternateSummaryWithHighlighting()}} setting 
maxAlternateFieldLength=18. Earlier it returned 
{{keyword is only here}}, but with the last patch I had 
to change it into {{keyword is only}}.

Currently I'm not able to debug tests in my IntelliJ 16, so I just changed the 
assert instead of digging further.

> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
> Fix For: 6.1
>
> Attachments: SOLR-8583.patch, SOLR-8583.patch, SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> This issue will cause alternate field to be highlighted with no snippet 
> generation, and still respect max length. You can turn it off using new param 
> {{hl.highlightAlternate=false}}. Supported highlighters: Simple, FVH



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-25 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Description: 
Today, you can configure hl.alternateField for highlighter to display if no 
snippets were produced from original field. But the contents of the fallback 
field is output without highlighting the original query terms.

This issue will cause alternate field to be highlighted with no snippet 
generation, and still respect max length. You can turn it off using new param 
{{hl.highlightAlternate=false}}. Supported highlighters: Simple, FVH

  was:
Today, you can configure hl.alternateField for highlighter to display if no 
snippets were produced from original field. But the contents of the fallback 
field is output without highlighting the original query terms.

This issue will introduce a new param {{hl.highlightAlternate=true}}, which 
will then cause alternate field to be highlighted with no snippet generation, 
and still respect max length.


> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
> Fix For: 6.1
>
> Attachments: SOLR-8583.patch, SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> This issue will cause alternate field to be highlighted with no snippet 
> generation, and still respect max length. You can turn it off using new param 
> {{hl.highlightAlternate=false}}. Supported highlighters: Simple, FVH



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-25 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Attachment: SOLR-8583.patch

New patch:
* Avoid swapping in/out solrParams on the request
* Use FVH on the alternate if that is what user has configured
* Support field overrides {{f.fieldname.hl.*}} across the board
* Add tests with/without fieldLength
* Add tests with custom pre/post for both simple and fvh
* Now enabled by default, have to set {{hl.highlightAlternate=false}} to turn 
off

Still no support for PostingsHighlighter

> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
> Fix For: 6.1
>
> Attachments: SOLR-8583.patch, SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> This issue will introduce a new param {{hl.highlightAlternate=true}}, which 
> will then cause alternate field to be highlighted with no snippet generation, 
> and still respect max length.



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-24 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Description: 
Today, you can configure hl.alternateField for highlighter to display if no 
snippets were produced from original field. But the contents of the fallback 
field is output without highlighting the original query terms.

This issue will introduce a new param {{hl.highlightAlternate=true}}, which 
will then cause alternate field to be highlighted with no snippet generation, 
and still respect max length.

  was:
Today, you can configure hl.alternateField for highlighter to display if no 
snippets were produced from original field. But the contents of the fallback 
field is output without highlighting the original query terms.

Suggest that the alternate field is subject to highlighting only, not snippet 
generation.


> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
> Fix For: 6.1
>
> Attachments: SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> This issue will introduce a new param {{hl.highlightAlternate=true}}, which 
> will then cause alternate field to be highlighted with no snippet generation, 
> and still respect max length.



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-24 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Attachment: SOLR-8583.patch

Attaching a first working patch.

There is a new param {{hl.highlightAlternate=true}} which when enabled will 
apply the standard highlighter on the alternate field.

We do this by calling {{doHighlightingByHighlighter()}} again on the alternate 
field, but with some hardcoded parameters: 
{{hl.snippets=1=Int.MAX}}. We also set {{hl.maxAnalyzedChars}} 
equal to {{hl.maxAlternateFieldLength}} if applicable.

There is one TODO. To be able to override these params, I needed to clone the 
{{SolrParams}} object on the request and replace it with a 
{{ModifialbleSolrParams}}, and then put back the old. Might not be thread 
safe... Perhaps a better way is to add a new {{params}} argument to 
doHighlightingByHighlighter?

Also, I have not tested what happens if people use some other highlighter like 
FVH. I suspect that other highlighters may not respect {{hl.pre}}?

> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
> Fix For: 6.1
>
> Attachments: SOLR-8583.patch
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> Suggest that the alternate field is subject to highlighting only, not snippet 
> generation.



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-24 Thread JIRA

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jan Høydahl updated SOLR-8583:
--
Fix Version/s: 6.1

> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>Assignee: Jan Høydahl
> Fix For: 6.1
>
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> Suggest that the alternate field is subject to highlighting only, not snippet 
> generation.



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Updated] (SOLR-8583) Apply highlighting to hl.alternateField

2016-01-22 Thread David Smiley (JIRA)

 [ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Smiley updated SOLR-8583:
---
Component/s: (was: spellchecker)
 highlighter

> Apply highlighting to hl.alternateField
> ---
>
> Key: SOLR-8583
> URL: https://issues.apache.org/jira/browse/SOLR-8583
> Project: Solr
>  Issue Type: Improvement
>  Components: highlighter
>Affects Versions: 5.4
>Reporter: Jan Høydahl
>
> Today, you can configure hl.alternateField for highlighter to display if no 
> snippets were produced from original field. But the contents of the fallback 
> field is output without highlighting the original query terms.
> Suggest that the alternate field is subject to highlighting only, not snippet 
> generation.



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

-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org