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

David Smiley commented on LUCENE-7091:
--------------------------------------

bq. Returning the same doc values instance for binary, sorted, number and 
sorted number doc values is fine, but not for sorted set doc values. 

Good point.

Some comments:

* addField: unfortunately this method is very long and it's difficult to 
follow.  I understand that it's not easy to split it up because of the number 
of local variables.  One thing that would help is renaming "longValues" and 
"bytesValuesSet" to make them clearly associated with doc-values.  I suggest 
"dvLongValues" and "dvBytesValuesSet" and add a comment to the former {{//NOT a 
set}}.  Another thing that would help is comments to declare the different 
phases of this method... like definitely before the switch(docValuesType) and 
at other junctures.  But I already see some code duplication in how 
numericProducer & binaryProducer are initialized.  Here's an idea:  Maybe Info 
could be changed to hold this state mutably.  Then, there wouldn't be a long 
stage of pulling out each var from the info only to put it all back again.  If 
this idea is successful, there would be much fewer local variables, and then 
you could easily extract a method to handle the DV stuff and a separate method 
for the Terms stuff.  What do you think?

* instead of freeze() knowing to call both getNormDocValues & prepareDocValues 
(and to sort terms), I suggest that freeze be implemented on each Info where 
those methods can be called there.  I think that's easier to maintain.

... to be continued; I didn't finish reviewing ...

> Add doc values support to MemoryIndex
> -------------------------------------
>
>                 Key: LUCENE-7091
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7091
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Martijn van Groningen
>         Attachments: LUCENE-7091.patch, LUCENE-7091.patch, LUCENE-7091.patch
>
>
> Sometimes queries executed via the MemoryIndex require certain things to be 
> stored as doc values. Today this isn't possible because the memory index 
> doesn't support this and these queries silently return no results.



--
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