You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Luca Cavanna (JIRA)" <ji...@apache.org> on 2013/08/09 12:00:51 UTC

[jira] [Commented] (LUCENE-4906) PostingsHighlighter's PassageFormatter should allow for rendering to arbitrary objects

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

Luca Cavanna commented on LUCENE-4906:
--------------------------------------

Hi Mike,
I had a look at your patch, looks good to me. Being able to get back arbitrary objects is a great improvement.

The only thing I would love to improve here is the need to cast the returned Objects to the type that the custom PassageFormatter uses.

We could work around this using generics, but the fact that the PassageFormatter can vary per field makes it harder. The only way I see to work around this is to prevent the PassageFormatter from returning different types of objects per field. That would mean that even though every field can have his own PassageFormatter, they all must return the same type. It kinda makes sense to me since I wouldn't want to have heterogeneous types in the Map<Integer, Object>, but that is something that's currently possible. What do you think?
                
> PostingsHighlighter's PassageFormatter should allow for rendering to arbitrary objects
> --------------------------------------------------------------------------------------
>
>                 Key: LUCENE-4906
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4906
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>         Attachments: LUCENE-4906.patch
>
>
> For example, in a server, I may want to render the highlight result to JsonObject to send back to the front-end. Today since we render to string, I have to render to JSON string and then re-parse to JsonObject, which is inefficient...
> Or, if (Rob's idea:) we make a query that's like MoreLikeThis but it pulls terms from snippets instead, so you get proximity-influenced salient/expanded terms, then perhaps that renders to just an array of tokens or fragments or something from each snippet.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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