Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is it possible to crawl a BDC content source with an entity that has a property of type string array (System.String[])?

At one point I had this working successfully in my dev environment but it longer works and I can't figure out why.

Environment is SharePoint 2010 and Search (not using FAST).

I've successfully created a BDC model that connects to a WCF Service and contains an Entity. The entity looks like this:

    <Entity Namespace="MyCompany.KM" Version="1.0.5.0" EstimatedInstanceCount="10000" Name="MyCompanyArchives" DefaultDisplayName="My Company Archives">
      <Properties>
        <Property Name="Title" Type="System.String">DisplayTitle</Property>
      </Properties>
      <Identifiers>
        <Identifier TypeName="System.Int32" Name="IdentifierId" />
      </Identifiers>
      <Methods>
        <Method IsStatic="false" Name="ReadItem">
          <Parameters>
            <Parameter Direction="In" Name="id">
              <TypeDescriptor TypeName="System.Int32" IdentifierName="IdentifierId" Name="id" />
            </Parameter>
            <Parameter Direction="Return" Name="ReadItem">
              <TypeDescriptor TypeName="BCSServiceProxy.MyCompanyArchives, MyCompanyArchives" Name="MyCompanyArchiveItem">
                <TypeDescriptors>
                  <TypeDescriptor TypeName="System.Int32" ReadOnly="true" IdentifierName="IdentifierId" Name="Record_No" />
                  <TypeDescriptor TypeName="System.DateTime" Name="Date_modified">
                    <Interpretation>
                      <NormalizeDateTime LobDateTimeMode="UTC" />
                    </Interpretation>
                  </TypeDescriptor>
                  <TypeDescriptor TypeName="System.String" Name="DisplayTitle" />
                  <TypeDescriptor TypeName="System.String[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="Personal_name">
                    <TypeDescriptors>
                      <TypeDescriptor TypeName="System.String" Name="Personal_nameElement" />
                    </TypeDescriptors>
                  </TypeDescriptor>
                </TypeDescriptors>
              </TypeDescriptor>
            </Parameter>
          </Parameters>
          <MethodInstances>
            <MethodInstance Type="SpecificFinder" ReturnParameterName="ReadItem" Default="true" Name="ReadItem" DefaultDisplayName="Read Item MyCompanyArchives">
              <Properties>
                <Property Name="LastDesignedOfficeItemType" Type="System.String">None</Property>
              </Properties>
            </MethodInstance>
          </MethodInstances>
        </Method>
        <Method IsStatic="false" Name="ReadIds">
          <FilterDescriptors>
            <FilterDescriptor Type="LastId" Name="LastIdSeen"/>
          </FilterDescriptors>
          <Parameters>
            <Parameter Direction="In" Name="LastIdSeen">
              <TypeDescriptor TypeName="System.Int32" IdentifierName="IdentifierId" AssociatedFilter="LastIdSeen" Name="LastIdSeen" />
            </Parameter>
            <Parameter Direction="Return" Name="ReadIds">
              <TypeDescriptor TypeName="BCSServiceProxy.MyCompanyArchives[], MyCompanyArchives" IsCollection="true" Name="ReadIds">
                <TypeDescriptors>
                  <TypeDescriptor TypeName="BCSServiceProxy.MyCompanyArchives, MyCompanyArchives" Name="MyCompanyArchivesItem">
                    <TypeDescriptors>
                      <TypeDescriptor TypeName="System.DateTime" Name="Date_modified">
                        <Interpretation>
                          <NormalizeDateTime LobDateTimeMode="UTC" />
                        </Interpretation>
                      </TypeDescriptor>
                      <TypeDescriptor TypeName="System.String" Name="DisplayTitle">
                        <Properties>
                          <Property Name="ShowInPicker" Type="System.Boolean">true</Property>
                        </Properties>
                      </TypeDescriptor>
                      <TypeDescriptor TypeName="System.String[], mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="Personal_name">
                        <TypeDescriptors>
                          <TypeDescriptor TypeName="System.String" Name="Personal_nameElement" />
                        </TypeDescriptors>
                      </TypeDescriptor>
                      <TypeDescriptor TypeName="System.Int32" ReadOnly="true" IdentifierName="IdentifierId" Name="Record_No" />
                    </TypeDescriptors>
                  </TypeDescriptor>
                </TypeDescriptors>
              </TypeDescriptor>
            </Parameter>
          </Parameters>
          <MethodInstances>
            <MethodInstance Type="Finder" ReturnParameterName="ReadIds" Default="true" Name="ReadIds" DefaultDisplayName="MyCompanyArchives Read Ids">
              <Properties>
                <Property Name="RootFinder" Type="System.String"></Property>
                <Property Name="UseClientCachingForSearch" Type="System.String"></Property>
                <Property Name="LastModifiedTimeStampField" Type="System.String">Date_modified</Property>
              </Properties>
            </MethodInstance>
          </MethodInstances>
        </Method>
      </Methods>
    </Entity>

I've created a search content source to crawl this BDC but I'm getting errors when I run a crawl. The problem seems to be due to the Personal_name property which is a string array (System.String[]).

In a crawl I get for example 169 successes and 551 errors. The 169 successes that show up in search results are all records that don't have a value for Personal_name and the WCF service returns a null object. The 551 errors that don't show up in search results are all records that do have a value for Personal_name and the WCF service returns a string array.

The error logs contain what seems to be a random assortment of the following errors:

FLTRDMN: Errorinfo is "Unexpected end of file has occurred. The following elements are not closed: SerializedEntityInstance. Line 54, position 4." [fltrsink.cxx:553] d:\office\source\search\native\mssdmn\fltrsink.cxx

FLTRDMN: Errorinfo is "There is an unclosed literal string. Line 54, position 28." [fltrsink.cxx:553] d:\office\source\search\native\mssdmn\fltrsink.cxx

FLTRDMN: Errorinfo is "Unexpected end of file while parsing Name has occurred. Line 52, position 38." [fltrsink.cxx:553] d:\office\source\search\native\mssdmn\fltrsink.cxx

share|improve this question
add comment

2 Answers 2

Probably two years too late, but I've got the following multi-value property in my Entity that works fine:

<TypeDescriptor Name="Subjects" TypeName="System.String[]" />

Note that I didn't specify 'sub' TypeDescriptors, could that be the difference? Also, I'm using FAST, but I'm not sure if that is of any influence...

~Mark

share|improve this answer
add comment

I ran into the same problem and solved it by replacing the String[] by a IEnumerable<StringWrapper>, or in your case IEnumerable<Personal_nameElement>.

This could look like:

public class Personal_nameElement
{
  public String Value { get; set; }
}

And in the BDC:

<TypeDescriptor Name="Personal_name" TypeName="System.Collections.Generic.IEnumerable`1[[Personal_nameElement]]" IsCollection="true">
    <TypeDescriptors>
      <TypeDescriptor Name="Personal_nameElement" TypeName="Personal_nameElement" IsCollection="false">
        <TypeDescriptors>
          <TypeDescriptor Name="Value" TypeName="System.String" />
        </TypeDescriptors>
      </TypeDescriptor>
    </TypeDescriptors>
</TypeDescriptor>

The property of your entity class would be:

public IEnumerable<Personal_nameElement> Personal_name { get; set; }

In my case the errors went away and the list content was indexed properly.

Side note: Replacing String[] by IEnumarable<String> (without the additional wrapper) did not work and lead to the same errors as before.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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