0

If I save a string value "7ab" in an Integer field in sitecore the ContentSearch breaks with "Input string was not in a correct format." when it tries to map back to the object.

I have tried

fieldReader fieldTypeName="integer" fieldNameFormat="{0}" fieldReaderType="Sitecore.ContentSearch.FieldReaders.NumericFieldReader, Sitecore.ContentSearch"
  • And why do you have string in integer field? – Marek Musielak Jul 5 at 11:21
  • There are several automated processes which update fields, and I'm receiving this error, but if I clear the cache and re-index it works. So primarily I'm trying to prevent this error then I'll try and ascertain what is setting it to an incorrect value. – Matthew Butler Jul 5 at 11:24
  • What is your actual question? It seems obvious that a string should not be in an integer... – Gatogordo Jul 5 at 12:03
  • I would like to prevent this issue. I looks like the NumericFieldReader is setting the value to null, and the mapper is throwing an exception when it tries to map the null to an INT – Matthew Butler Jul 5 at 12:07
  • Just make sure you don't have non-integer values in that integer field. Why you want to fix results instead of fixing reasons? – Marek Musielak Jul 5 at 13:01
0

I created a IntegerFieldReader from NumericFieldReader and defaulted to 0 instead of null

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.