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

Michael McCandless commented on LUCENE-5833:
--------------------------------------------

Net/net I agree it makes sense for DocumentDictionary to be able to handle 
multi-valued fields.

Isn't that first {{if (term.size() == 0)}} always be true?  If terms is 
non-empty we return the first one at the start of the loop?

Also it seems like you can remove the if in the end?  The loop will just cycle 
around and return the first term if there is one?  Maybe we can somehow 
simplify this "loop within a loop"...

I don't like that there's O(N^2) here (terms.remove(0) from an ArrayList) ... 
can we fix that?  Yeah, N should be small in general, but you never know ... I 
don't like having secret adversaries to our code ... maybe you can just hang 
onto the StorableField[] from the current doc and step through it; then you 
don't need to alloc this separate ArrayList...

Can you rename terms to something like currentDocTerms?  (Separately it's 
strange we call these "terms"; they are really intended to be "suggestions" 
right?).

Styling: there should be a space after "if" and before ( in "if(...)"

> Suggestor Version 2 doesn't support multiValued fields
> ------------------------------------------------------
>
>                 Key: LUCENE-5833
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5833
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/other
>    Affects Versions: 4.8.1
>            Reporter: Greg Harris
>            Assignee: Steve Rowe
>         Attachments: LUCENE-5833.patch, SOLR-6210.patch
>
>
> So if you use a multiValued field in the new suggestor it will not pick up 
> terms for any term after the first one. So it treats the first term as the 
> only term it will make it's dictionary from. 
> This is the suggestor I'm talking about:
> https://issues.apache.org/jira/browse/SOLR-5378



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to