Find model properties returning null


I have a model DeliveryLocation which is indexed using Find. If I look at a specific object in the index (using Find Explorer), I can see that that all properties on the model has correct values. One of the properties is called DelliveryCode: 

"DeliveryCode$$string": "3118155"

However, when I retrieve the object using a Find query, DeliveryCode and several other properties is null. 

Anyone seen this behavior before? Is it a bug?

Jul 10, 2013 13:25

Hi Mari,

First off is DeliveryCode a string in your class? Why I am asking is that it is indexed as a string but it contains only numbers. Could it be that you have change the backing property from string to int? Then this might happen since it then can't bind it correctly when deserializing.


Jul 10, 2013 13:45
Jul 10, 2013 13:45

@Markus: The DeliveryCode property is of type string:

public string DeliveryCode { get; set; }

@Petter: I'm using a Find query to retrieve a list of DeliveryLocation objects - note that this is not CMS data. 

The query looks like this:

List<FindModels.DeliveryLocation> result = 
   .Filter(f => f.DeliveryZipCode.Match(zipCode))
   .Filter(f => f.CountryCode.MatchCaseInsensitive(countryCode))



Edited, Jul 10, 2013 13:51

Marcus, I will try changing model type from string to int.

Jul 10, 2013 13:56

I don't think that is an issue. Was only if you had changed types and not reindexed. And the backing class didn't represent the object in the index correct. 

Are we 100% certaain that all models have DeliveryCode set? I have never seen this before so I am trying to rue out the obvious first.

Jul 10, 2013 14:02

Yes, DeliveryCode is set. This happens on all results/queries: I have two properties that are of type string in the index:

"DeliveryZipCode$$string": "0767",
"DeliveryCode$$string": "3118155",

- they are always null when model is returned from a query.


Jul 10, 2013 14:22

@Marcus: Could be be some kind of serialization issue?

Jul 16, 2013 7:58

I must admit this is very strange. 

It could be a serilization issue but then you should see some errors in the log if you have it turned on. Altho I doubt it since it doesn't seem to be the hardest thing to serialize.

Is it possible for you to try and reindex and see if it still remains?



Jul 16, 2013 9:01

Reindexing have no effect.

I've added the data to a test find service. If you want, I can email you the service address and model class - then you can test queries yourself. (I'll need you email address).

Jul 16, 2013 9:23

magr [at] 



Jul 16, 2013 9:35

Aparently this happens when my model class (the object I'm indexing) does not have a default empy contructor.

Jul 16, 2013 10:48