solr DataimportHanler fileld 出现null


I'm working with Solr's schema.xml, and I know that I can use the 'default' attribute to specify a default value which is to be used if a value for a given field has not been provided. However, say that I choose not to set the 'default' attribute, which default value will Solr then fall back to?

I would think that the field type which I've used for the given field would have a default value which would be used, but I have had not success finding any details about this. Alternatively, I'd think that not providing a value and not setting a default value effectively would be as if that field does not exist for the particular document.

However, I'm not sure and I'd like to know :-)

UPDATE

As far as I can see, Solr just throws an error and returns an error 400 "Bad Request" if no default value has been set and no value has been provided for a given field. In other words, Solr does not seem to apply any "fallback" default values in case no value is provided and no default value has been set in schema.xml.

http://stackoverflow.com/questions/7332122/solr-what-are-the-default-values-for-fields-which-does-not-have-a-default-value

猜你喜欢

转载自zha-zi.iteye.com/blog/1168206