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

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

I _really_ like how this refactor has turned out of making Info mutable.  

* I think the javadocs sentence you added to {{addField}} meant to use "if" not 
"is".
* In {{getInfoForExpectedDocValuesType()}}, the two checks using 
{{(info.fieldInfo.getDocValuesType()}} read a little weird/confusing to me but 
I get the gist of the intent.  Couldn't the first condition simply check 
{{expectedType == DocValuesType.NONE}} to return null?  That's logically the 
same I think and could even be checked at the very front of the method.
* getSortedSetDocValues's impl ought to reset index to 0 on setDocument().
* getDocsWithField doesn't need to actually implement a bits, it can use 
{{return new Bits.MatchAllBits(1);}}
* I think there's a bug in addField's positionIncrementGap & offsetGap 
handling.  If fields are added to MemoryIndex that are DV then terms data, the 
posInc & offset will get incremented when it shouldn't be.  This could be 
corrected by checking info.numTokens.  Please modify or add a test for this.  
The boost should be applied conditionally as well (only when storeTerms is 
invoked).
* {{storeDocValues()}}: for SORTED_NUMERIC I'm concerned about that growing 
algorithim... it's O(N^2) as it creates a new array each time that is just one 
larger.  Ouch.  Maybe use a straight-forward array doubling algorithm and keep 
track of the number of values?
* It's a shame that SORTED & BINARY use a BytesRefHash (adds overhead) and 
ultimately get sorted when, really, it's not necessary of course.  The 
ByteBlockPool could be used directly to store it (see BytesRefArray for 
examples) with a little bit of code.  This isn't a blocker but it would sure be 
nice.
* {{testDocValues()}} should test non-set behavior of sorted numerics, and set 
behavior of sorted set DV.  Could be done easily by changing or adding a couple 
lines of code.  Add term text here too, and under same field names as DV ones 
at that.

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