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

Michael McCandless commented on LUCENE-8601:
--------------------------------------------

Patch looks great [~muralikpbhat]; impressive how tiny the change is!

For Solr's {{SchemaField}} can you instead return a {{Collections.emptyMap}}, 
maybe statically initialized/stored somewhere?

Can we change the semantics to allow a {{null}} value to mean there are no 
attributes?  I'm a little worried about having users who do not set any 
attributes having to pay the (tiny) cost of creating empty {{HashMap}} and 
iterating over it.

Can you also add {{@lucene.experimental}} in the javadocs for the new methods, 
since this is a new API we should reserve the right to possibly change it again 
soon.

Can you also explain in the javadocs that there is no thread safety here, i.e. 
user must not add attributes while other threads are indexing documents with 
that field type.

> Adding attributes to IndexFieldType
> -----------------------------------
>
>                 Key: LUCENE-8601
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8601
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/index
>    Affects Versions: 7.5
>            Reporter: Murali Krishna P
>            Priority: Major
>         Attachments: LUCENE-8601.01.patch, LUCENE-8601.patch
>
>
> Today, we can write a custom Field using custom IndexFieldType, but when the 
> DefaultIndexingChain converts [IndexFieldType to 
> FieldInfo|https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/org/apache/lucene/index/DefaultIndexingChain.java#L662],
>  only few key informations such as indexing options and doc value type are 
> retained. The [Codec gets the 
> FieldInfo|https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/org/apache/lucene/codecs/DocValuesConsumer.java#L90],
>  but not the type details.
>   
>  FieldInfo has support for ['attributes'| 
> https://github.com/apache/lucene-solr/blob/master/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java#L47]
>  and it would be great if we can add 'attributes' to IndexFieldType also and 
> copy it to FieldInfo's 'attribute'.
>   
>  This would allow someone to write a custom codec (extending docvalueformat 
> for example) for only the 'special field' that he wants and delegate the rest 
> of the fields to the default codec.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to