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

2016-05-30 Thread JIRA

[ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15306396#comment-15306396
 ] 

Jan Høydahl commented on SOLR-8583:
---

Yey, commit bot actually started working for me again, after changing my JIRA 
email address to my @apache.org addr. Looks like there is a bug in the py 
script that skips commenting if user is not found in JIRA?

> 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] [Commented] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-30 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15306395#comment-15306395
 ] 

ASF subversion and git services commented on SOLR-8583:
---

Commit a460addd2f9511432da7684bd2ee6598025389ea in lucene-solr's branch 
refs/heads/branch_6x from [~janhoy]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a460add ]

SOLR-8583: Do not attempt highlight of alternate if it is same as original hl 
field
(cherry picked from commit 05ce40a)


> 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] [Commented] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-30 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15306393#comment-15306393
 ] 

ASF subversion and git services commented on SOLR-8583:
---

Commit 05ce40a0b9da5989613a20f985f9796ed533a8c4 in lucene-solr's branch 
refs/heads/master from [~janhoy]
[ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=05ce40a ]

SOLR-8583: Do not attempt highlight of alternate if it is same as original hl 
field


> 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] [Commented] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-29 Thread JIRA

[ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15305822#comment-15305822
 ] 

Jan Høydahl commented on SOLR-8583:
---

Documentation added to RefGuide.

> 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] [Commented] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-27 Thread David Smiley (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15304104#comment-15304104
 ] 

David Smiley commented on SOLR-8583:


This is certainly committable; I think you can commit it as-is if you want, or 
make further tweaks based on my remaining minor comments.  

You could move this line (that already existed) higher up so that you needn't 
re-pull it out in the highlighting alternate code
* int alternateFieldLen = params.getFieldInt(fieldName, 
HighlightParams.ALTERNATE_FIELD_LENGTH, 0);
* why the max(18,altFieldLen) ?  18 seems like a magic number if someone 
sets the alt field length to some silly low number then it's there prerogative 
to do so?

bq. If you search "keyword" on t_text you will not get any hits :-)

hehe, well, consider dismax with multiple fields.

Docs looks good, basically. I'll correct a small grammatical error.

> 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] [Commented] (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:comment-tabpanel&focusedCommentId=15303954#comment-15303954
 ] 

Jan Høydahl commented on SOLR-8583:
---

Added a suggested RefGuide documentation to 
https://cwiki.apache.org/confluence/display/solr/Standard+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
>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] [Commented] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-26 Thread David Smiley (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15302172#comment-15302172
 ] 

David Smiley commented on SOLR-8583:


This is looking *much* better -- nice job Jan!  That FvhContainer is perfect; 
I'm kicking myself for not thinking of that already.

The test exhibits a problem related to not using hl.requireFieldMatch.  Looking 
at the test, I see we have a query on tv_text yet we're asking to highlight 
t_text (falling back on tv_text as alternate).  What we assert is sensible 
based on these args, but this is an unnatural example.  A more natural example 
is that the query is on t_text -- the same field that is highlighted.  What 
should then happen?  Well, we could try and make it work by setting 
hl.requireFieldMatch=false or we could demand that this be set as a 
prerequisite to highlighting alternate fields.  Or we could leave the logic be 
and document that you most likely need to set this to false (what I'm kinda 
leaning to but I have no conviction).  Note that FVH doesn't support per-field 
overrides of that setting, so if we try to set that ourselves, then it won't 
work with FVH.  How to handle this is debatable. In any case, the tests should 
be expanded to query based on t_text in addition to what it tests now which is 
good to test too.

Minor quibbles:
* can you order the parameters to doHighlightingOfField to have more 
consistency with the other methods that take much of the same parameters: doc, 
docId, schemaField, fvhContainer, query, reader, req


> 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] [Commented] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-25 Thread David Smiley (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15301624#comment-15301624
 ] 

David Smiley commented on SOLR-8583:


Shouldn't this new logic be integrated with alternateField()'s logic?  It's 
confusing that it's separate, and makes this long method longer with a bit of 
dejavu logic.  Perhaps this is confounded by the awkwardness induced by the 
lazy init of re-using fvh & fvhFieldQuery?   Hmmm; maybe we should populate 
that eagerly if we detect FVH?  That ought to allow to move the code to not 
repeat our logic... maybe by extracting a method on the majority of the content 
of the field highlighting loop so we can invoke it for alternate field 
highlighting.  But again that's currently blocked by the lazy init.

RE passing SolrParams to the doHighlighting* methods, I think the caller should 
use SolrParams.wrapDefaults instead of making the callee do this.  In this way, 
the parameter is simply "params" without any reference to "invariant" 
terminology/semantics.  BTW I was fine with you calling req.setParams as you 
had it before -- less gotchas.  As it is, doHighlightingByHighlighter calls 
methods like getHighlighter and getPhraseHighlighter that don't have this 
overridden params.  It might not matter but it's problematic in principle at 
least.


> 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] [Commented] (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:comment-tabpanel&focusedCommentId=15299739#comment-15299739
 ] 

Jan Høydahl commented on SOLR-8583:
---

bq.  I do wonder if we want to introduce new options [...]
Agree. Think I'll keep the param but make it default to true, so people can 
turn it off to get old behavior

bq. I think swapping in and out the SolrParams on the request is fine, albeit 
unfortunate. Maybe do in try-finally. And maybe instead of loading up a new 
ModifiableSolrParams with all of the existing ones, this could be done with 
SolrParams.wrapDefault? Or just leave it; it works.
Found a way to avoid swapping. Instead the {{doHighlightingByXXX()}} methods 
take a new argument {{invariantParams}} which is then combined with 
{{wrapDefault}}. it works well and is less hacky.

bq. Instead of schema.getFieldOrNull for the alternate field, I think it should 
just call getField since it should be erroneous to refer to a non-existent 
field.
This caused test failure in existing tests. So I'm keeping old behavior that if 
fallbackField does not exist, nothing is output at all.

bq. Expect to see a new highlighter announced this year, and with it I will 
propose a bit of unification on the Solr side.
Looking forward to that!


> 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] [Commented] (SOLR-8583) Apply highlighting to hl.alternateField

2016-05-24 Thread David Smiley (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-8583?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15298350#comment-15298350
 ] 

David Smiley commented on SOLR-8583:


Hi [~janhoy], thanks for requesting my input.

Overall this looks good.  I do wonder if we want to introduce new options to 
the most overly configurable component there is when we could change the 
existing behavior, and perhaps nobody would notice.  In particular only if 
hl.requireFieldMatch=true (which is normally false) would this make sense, and 
then we could just simply do it without some new option.  

I think swapping in and out the SolrParams on the request is fine, albeit 
unfortunate.  Maybe do in try-finally.  And maybe instead of loading up a new 
ModifiableSolrParams with all of the existing ones, this could be done with 
SolrParams.wrapDefault?  Or just leave it; it works.

Instead of schema.getFieldOrNull for the alternate field, I think it should 
just call getField since it should be erroneous to refer to a non-existent 
field.

bq. Why cannot all highlighters use the same hl.tag.pre/post params?

I feel your pain!  And now we are stuck with it forever (sarcasm).  Expect to 
see a new highlighter announced this year, and with it I will propose a bit of 
unification on the Solr side.

> 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] [Commented] (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:comment-tabpanel&focusedCommentId=15298218#comment-15298218
 ] 

Jan Høydahl commented on SOLR-8583:
---

[~dsmiley] you know the code, any guidance on this?

> 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] [Commented] (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:comment-tabpanel&focusedCommentId=15298205#comment-15298205
 ] 

Jan Høydahl commented on SOLR-8583:
---

Perhaps {{SolrHighlighter}} abstract class should provide a new method {{String 
alternateField(String fieldName)}} and another {{abstract String[] 
alternateText(doc, fieldName, req)}}, so all implementations must relate to the 
same alternate fallback API?

> 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