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

Adrien Grand commented on LUCENE-4670:
--------------------------------------

bq. I still feel like we should do this to the stored fields api too though for 
consistency.

Agreed.

bq. Its good enough for to stare at it and be able to tell if it would be 
simpler

I think it would? Things like
{code}
    if (fieldCount == numVectorFields) {
      // last field of the document
      // this is crazy because the file format is crazy!
      for (int i = 1; i < fieldCount; i++) {
        tvd.writeVLong(fps[i] - fps[i-1]);
      }
    }
{code} in startField could become
{code}
    public void finishDocument() throws IOException {
      // last field of the document
      // this is crazy because the file format is crazy!
      for (int i = 1; i < fieldCount; i++) {
        tvd.writeVLong(fps[i] - fps[i-1]);
      }
    }
{code}

It would help simplify Lucene41StoredFieldsFormat too.

bq. it still leaves our default merge implementation untested because the 
wrapped codec implements bulk merge.

Do you have an idea how to test it?
                
> Add TermVectorsWriter.finish{Doc,Field,Term} to make development of new 
> formats easier
> --------------------------------------------------------------------------------------
>
>                 Key: LUCENE-4670
>                 URL: https://issues.apache.org/jira/browse/LUCENE-4670
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Assignee: Adrien Grand
>            Priority: Minor
>             Fix For: 4.1
>
>         Attachments: LUCENE-4670.patch, LUCENE-4670.patch
>
>
> This is especially useful to LUCENE-4599 where actions have to be taken after 
> a doc/field/term has been added.

--
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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to