[jira] Updated: (SOLR-82) specify default values in the schema

2006-12-20 Thread Hoss Man (JIRA)
 [ http://issues.apache.org/jira/browse/SOLR-82?page=all ]

Hoss Man updated SOLR-82:
-

Attachment: defaultValuesPatch2.patch

Ryan: i finally got a chance to look this over in depth (your second version) 
and I love it!

I'm attaching a patch with some minor modifications...

1) fixed a typo in SchemaField.toString
2) cleaned up some indenting oddness in the lines you modified
3) added the name of the field to your log.fine line in IndexSchema
4) added sample usage to the example schema and 1 exampledoc (utf8-example.xml)
5) replaced your new testclass with a single new method in 
BasicFunctionalityTest which not only tests that the default is there, but also 
that it can be explicitly set when adding the doc.

what do you think?

 specify default values in the schema
 

 Key: SOLR-82
 URL: http://issues.apache.org/jira/browse/SOLR-82
 Project: Solr
  Issue Type: Improvement
  Components: update
Reporter: Ryan McKinley
Priority: Minor
 Attachments: defaultValuesPatch.patch, defaultValuesPatch2.patch, 
 defaultValuesPatch2.patch


 It would be nice to specify a default value for a given field in the schema.  
 Chris Hostetter suggested this in:
 http://www.mail-archive.com/solr-user@lucene.apache.org/msg01564.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (SOLR-82) specify default values in the schema

2006-12-14 Thread Ryan McKinley (JIRA)
 [ http://issues.apache.org/jira/browse/SOLR-82?page=all ]

Ryan McKinley updated SOLR-82:
--

Attachment: defaultValuesPatch2.patch

This is a revised version that stores a list of fieldsWithDefaultValue in the 
schema and only cycles through them (rather then every field)

The important bit is in: DocumentBuilder.java

 public Document getDoc() {
  
// Check for default fields in our schema...
for( SchemaField field : schema.getFieldsWithDefaultValue() ) {
  if( doc.getField( field.getName() ) == null ) {
doc.add( field.createField( field.getDefaultValue(), 1.0f ) );
  }
}
  
Document ret = doc; doc=null;
return ret;
  }



 specify default values in the schema
 

 Key: SOLR-82
 URL: http://issues.apache.org/jira/browse/SOLR-82
 Project: Solr
  Issue Type: Improvement
  Components: update
Reporter: Ryan McKinley
Priority: Minor
 Attachments: defaultValuesPatch.patch, defaultValuesPatch2.patch


 It would be nice to specify a default value for a given field in the schema.  
 Chris Hostetter suggested this in:
 http://www.mail-archive.com/solr-user@lucene.apache.org/msg01564.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] Updated: (SOLR-82) specify default values in the schema

2006-12-13 Thread Ryan McKinley (JIRA)
 [ http://issues.apache.org/jira/browse/SOLR-82?page=all ]

Ryan McKinley updated SOLR-82:
--

Attachment: defaultValuesPatch.patch

This modifies SchemaField.java to keep a defaultValue and 
DocumentBuilder.java makes sure they exist when returning the document.

The test is not totally adequate (i'm not so good with XPath yet..) but it does 
make sure a date specified in the schema exists

 specify default values in the schema
 

 Key: SOLR-82
 URL: http://issues.apache.org/jira/browse/SOLR-82
 Project: Solr
  Issue Type: Improvement
  Components: update
Reporter: Ryan McKinley
Priority: Minor
 Attachments: defaultValuesPatch.patch


 It would be nice to specify a default value for a given field in the schema.  
 Chris Hostetter suggested this in:
 http://www.mail-archive.com/solr-user@lucene.apache.org/msg01564.html

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira