0

I have the following fields in my model:

public virtual IEnumerable<Person> Authors { get; set; }
public virtual IEnumerable<ExternalContributor> External_Contributors { get; set; }

[IndexField("Authors")]
[TypeConverter(typeof(IndexFieldGuidValueConverter))]
public virtual IEnumerable<Guid> AuthorIds { get; set; }

[IndexField("External Contributors")]
[TypeConverter(typeof(IndexFieldGuidValueConverter))]
public virtual IEnumerable<Guid> ExternalContributorIds { get; set; }

and I have a MultiList of GuiD in the fields "Authors" and "External Contributors". When I try to access those fields, "Authors" is populated with a list of objects, while External_Contributors is always empty.

Is there something obvious I am missing here?


EDIT: Here are the definitions for Person and ExternalContributor:

[SitecoreType(TemplateId = "{2CD821FC-A334-49F4-93B9-CB0D8E7D71FF}", AutoMap = true)]
    public class Person : ImageTemplate, ITagged, IViewImage, IViewCover, ISectors, ISpecialisms, IEquatable<Person>
    {
        public static string ParentPath = "/sitecore/content/Data/People";
        public static Guid Template = new Guid("{2CD821FC-A334-49F4-93B9-CB0D8E7D71FF}");

        [...various fields...]
    }
}

[SitecoreType(TemplateId = "{7C35993C-140B-43FE-A00A-7ADA00A2A488}", AutoMap = true)]
    public class ExternalContributor : ImageTemplate, ITagged, IViewImage, IEquatable<ExternalContributor>
    {
        public static string ParentPath = "/sitecore/content/Blue Rubicon Data/external-contributors";
        public static Guid Template = new Guid("{7C35993C-140B-43FE-A00A-7ADA00A2A488}");

        [...various fields...]
    }
}
Emanuele Ciriachi
  • 2,216
  • 2
  • 26
  • 39
  • Can you post the class definitions for Person and ExternalContributor – Elena Mosoff Apr 08 '15 at 15:40
  • Done - is this what you were looking for, or you need to know the individual fields of those classes? – Emanuele Ciriachi Apr 08 '15 at 15:52
  • Is only External_Contributors empty? Or both External_Contributors and ExternalContributorIds? If both are empty, Vicent Galiana below has a good point. You can use a tool like Luke (https://code.google.com/p/luke/) to see if your index field name for that field matches the name you've specified in your attribute. – Elena Mosoff Apr 08 '15 at 16:28

1 Answers1

2

What about something like this: [IndexField("External_Contributors")]

I'm not sure, but I've never seen a index field with spaces, I don't know if the fieldname translator (if it still exists) would fix it.

You should re-index your items after applying your change before it may work.

Vicent Galiana
  • 328
  • 4
  • 15