[jira] [Commented] (SOLR-4676) Share a Lucene FieldType instance instead of creating on each call to createField()

2013-04-05 Thread David Smiley (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-4676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13623664#comment-13623664
 ] 

David Smiley commented on SOLR-4676:


bq. Why? this is a valid configuration. You might think its odd, but -1 to 
removing this.

That aspect of my patch was incidental to my objective (share Lucene FieldType) 
and it doesn't matter that much to me even though I think it's kinda lame; so 
I'll put that back in my subsequent patch to satisfy your concern.

Do you have any other feedback?

bq. For reference, returning null in createField for docvalues-only fields 
caused SOLR-4647.

Thanks for that reference, Adrien.  The way you worded this suggests it's a 
problem for createField to return null.  But that has been a normal accepted 
behavior of createField that may as well be set in stone now for Solr.  If I 
had to start the API from scratch, createField() would not even exist because 
the notion that there is exactly one Lucene field per Solr field is patently 
false.  I'll add my suggested solution to SOLR-4647 to that issue.

 Share a Lucene FieldType instance instead of creating on each call to 
 createField()
 ---

 Key: SOLR-4676
 URL: https://issues.apache.org/jira/browse/SOLR-4676
 Project: Solr
  Issue Type: Improvement
  Components: Schema and Analysis
Reporter: David Smiley
Assignee: David Smiley
Priority: Minor
 Attachments: SOLR-4676_Share_Lucene_FieldType_in_SchemaField.patch


 I think the Lucene FieldType instances should be cached on Solr's SchemaField 
 so that they don't have to be needlessly re-created for each indexed value 
 that runs through Solr in SchemaField.createField(). The only obstacle I see 
 to this is that getIndexOptions(field,val) takes the value, and if that value 
 were to alter the logic then the FieldType can't be shared. This is a 
 protected method and I don't see anything that overrides it, and the default 
 implementation doesn't use the value. So I think it can be removed.  Patch in 
 progress...

--
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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-4676) Share a Lucene FieldType instance instead of creating on each call to createField()

2013-04-05 Thread Adrien Grand (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-4676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13623698#comment-13623698
 ] 

Adrien Grand commented on SOLR-4676:


bq. The way you worded this suggests it's a problem for createField to return 
null.

That was not my intention. I just wanted to say that returning null not only 
has implications on indexing but also on some components that use this method 
to transform strings to objects, such as grouping.

 Share a Lucene FieldType instance instead of creating on each call to 
 createField()
 ---

 Key: SOLR-4676
 URL: https://issues.apache.org/jira/browse/SOLR-4676
 Project: Solr
  Issue Type: Improvement
  Components: Schema and Analysis
Reporter: David Smiley
Assignee: David Smiley
Priority: Minor
 Attachments: SOLR-4676_Share_Lucene_FieldType_in_SchemaField.patch


 I think the Lucene FieldType instances should be cached on Solr's SchemaField 
 so that they don't have to be needlessly re-created for each indexed value 
 that runs through Solr in SchemaField.createField(). The only obstacle I see 
 to this is that getIndexOptions(field,val) takes the value, and if that value 
 were to alter the logic then the FieldType can't be shared. This is a 
 protected method and I don't see anything that overrides it, and the default 
 implementation doesn't use the value. So I think it can be removed.  Patch in 
 progress...

--
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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-4676) Share a Lucene FieldType instance instead of creating on each call to createField()

2013-04-05 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-4676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13623756#comment-13623756
 ] 

Robert Muir commented on SOLR-4676:
---

{quote}
If I had to start the API from scratch, createField() would not even exist 
because the notion that there is exactly one Lucene field per Solr field is 
patently false. I'll add my suggested solution to SOLR-4647 to that issue.
{quote}

{quote}
That was not my intention. I just wanted to say that returning null not only 
has implications on indexing but also on some components that use this method 
to transform strings to objects, such as grouping.
{quote}

I agree with both of these statements. Can we remove createField() and 
eliminate this trap?
DocumentBuilder only calls createFields() and thats... the only thing that 
should be calling this method?

Grouping should be doing something else.



 Share a Lucene FieldType instance instead of creating on each call to 
 createField()
 ---

 Key: SOLR-4676
 URL: https://issues.apache.org/jira/browse/SOLR-4676
 Project: Solr
  Issue Type: Improvement
  Components: Schema and Analysis
Reporter: David Smiley
Assignee: David Smiley
Priority: Minor
 Attachments: SOLR-4676_Share_Lucene_FieldType_in_SchemaField.patch


 I think the Lucene FieldType instances should be cached on Solr's SchemaField 
 so that they don't have to be needlessly re-created for each indexed value 
 that runs through Solr in SchemaField.createField(). The only obstacle I see 
 to this is that getIndexOptions(field,val) takes the value, and if that value 
 were to alter the logic then the FieldType can't be shared. This is a 
 protected method and I don't see anything that overrides it, and the default 
 implementation doesn't use the value. So I think it can be removed.  Patch in 
 progress...

--
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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-4676) Share a Lucene FieldType instance instead of creating on each call to createField()

2013-04-05 Thread Adrien Grand (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-4676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13623762#comment-13623762
 ] 

Adrien Grand commented on SOLR-4676:


{quote}
I agree with both of these statements. Can we remove createField() and 
eliminate this trap?
DocumentBuilder only calls createFields() and thats... the only thing that 
should be calling this method?
{quote}

+1

 Share a Lucene FieldType instance instead of creating on each call to 
 createField()
 ---

 Key: SOLR-4676
 URL: https://issues.apache.org/jira/browse/SOLR-4676
 Project: Solr
  Issue Type: Improvement
  Components: Schema and Analysis
Reporter: David Smiley
Assignee: David Smiley
Priority: Minor
 Attachments: SOLR-4676_Share_Lucene_FieldType_in_SchemaField.patch


 I think the Lucene FieldType instances should be cached on Solr's SchemaField 
 so that they don't have to be needlessly re-created for each indexed value 
 that runs through Solr in SchemaField.createField(). The only obstacle I see 
 to this is that getIndexOptions(field,val) takes the value, and if that value 
 were to alter the logic then the FieldType can't be shared. This is a 
 protected method and I don't see anything that overrides it, and the default 
 implementation doesn't use the value. So I think it can be removed.  Patch in 
 progress...

--
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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-4676) Share a Lucene FieldType instance instead of creating on each call to createField()

2013-04-04 Thread Robert Muir (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-4676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13622839#comment-13622839
 ] 

Robert Muir commented on SOLR-4676:
---

{quote}
One inconsistency I found as a side-effect of this is that if a TrieField was 
docValues enabled, yet not stored nor indexed, createField() would return 
non-null – a Field not marked as stored or indexed. That was odd and I changed 
that.
{quote}

Why? this is a valid configuration. You might think its odd, but -1 to removing 
this.

 Share a Lucene FieldType instance instead of creating on each call to 
 createField()
 ---

 Key: SOLR-4676
 URL: https://issues.apache.org/jira/browse/SOLR-4676
 Project: Solr
  Issue Type: Improvement
  Components: Schema and Analysis
Reporter: David Smiley
Assignee: David Smiley
Priority: Minor
 Attachments: SOLR-4676_Share_Lucene_FieldType_in_SchemaField.patch


 I think the Lucene FieldType instances should be cached on Solr's SchemaField 
 so that they don't have to be needlessly re-created for each indexed value 
 that runs through Solr in SchemaField.createField(). The only obstacle I see 
 to this is that getIndexOptions(field,val) takes the value, and if that value 
 were to alter the logic then the FieldType can't be shared. This is a 
 protected method and I don't see anything that overrides it, and the default 
 implementation doesn't use the value. So I think it can be removed.  Patch in 
 progress...

--
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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org



[jira] [Commented] (SOLR-4676) Share a Lucene FieldType instance instead of creating on each call to createField()

2013-04-04 Thread Adrien Grand (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-4676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13622925#comment-13622925
 ] 

Adrien Grand commented on SOLR-4676:


For reference, returning null in createField for docvalues-only fields caused 
SOLR-4647.

 Share a Lucene FieldType instance instead of creating on each call to 
 createField()
 ---

 Key: SOLR-4676
 URL: https://issues.apache.org/jira/browse/SOLR-4676
 Project: Solr
  Issue Type: Improvement
  Components: Schema and Analysis
Reporter: David Smiley
Assignee: David Smiley
Priority: Minor
 Attachments: SOLR-4676_Share_Lucene_FieldType_in_SchemaField.patch


 I think the Lucene FieldType instances should be cached on Solr's SchemaField 
 so that they don't have to be needlessly re-created for each indexed value 
 that runs through Solr in SchemaField.createField(). The only obstacle I see 
 to this is that getIndexOptions(field,val) takes the value, and if that value 
 were to alter the logic then the FieldType can't be shared. This is a 
 protected method and I don't see anything that overrides it, and the default 
 implementation doesn't use the value. So I think it can be removed.  Patch in 
 progress...

--
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: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org