5

I am writing a custom indexing connector using changelog incremental crawl approach.

I'm using sample from http://msdn.microsoft.com/en-us/library/ff625800%28v=office.14%29.aspx and trying to change it for me.

My model has next stereotypes: IdEnumerator, ChangedIdEnumerator, DeletedIdEnumerator, SpecificFinder, Finder, StreamAccessor

If I'm starting full crawl, IdEnumerator, ChangedIdEnumerator, DeletedIdEnumerator will be called.

First problem: the SpecificFinder is not called.

If I'm starting incremental crawl, ChangedIdEnumerator and DeletedIdEnumerator will be called.

DeletedIdEnumerator is working: items with deleted ids are deleted from the index.

Second problem: ChangedIdEnumerator is not working. Nothing happens after I returned the changed ids.

There are now errors in the crowl log.

My model is here:

<Model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Name="MyFileModel" xmlns="http://schemas.microsoft.com/windows/2007/BusinessDataCatalog">
  <LobSystems>
    <LobSystem Name="MyFileSystem" Type="Custom">
      <Properties>
        <Property Name="SystemUtilityTypeName" Type="System.String">MyFileConnector.MyFileConnector, MyFileConnector, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15865f58b9878bf8</Property>
        <Property Name="SystemUtilityInstallDate" Type="System.DateTime">2013-01-01 00:00:00Z</Property>
        <Property Name="InputUriProcessor" Type="System.String">MyFileConnector.MyFileLobUri, MyFileConnector, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15865f58b9878bf8</Property>
        <Property Name="OutputUriProcessor" Type="System.String">MyFileConnector.MyFileNamingContainer, MyFileConnector, Version=1.0.0.0, Culture=neutral, PublicKeyToken=15865f58b9878bf8</Property>
      </Properties>
      <LobSystemInstances>
        <LobSystemInstance Name="MyFileConnector_instance">
          <Properties>
            <Property Name="AuthenticationType" Type="System.String">Credentials</Property>
         </Properties>
        </LobSystemInstance>
      </LobSystemInstances>
  <Entities>
    <Entity Name="MyFolder" Namespace="MyFileConnector" Version="1.0.0.1">
      <Properties>
        <Property Name="Title" Type="System.String">Name</Property>
      </Properties>
      <Identifiers>
        <Identifier Name="ID" TypeName="System.String" />
      </Identifiers>

      <Methods>
        <!--        IdEnumerator          -->
        <Method Name="ReadAllIds" DefaultDisplayName="ReadAllIds" IsStatic="false">
          <Parameters>
            <Parameter Name="returnIds" Direction="Return">
              <TypeDescriptor Name="Nodes" TypeName="Microsoft.BusinessData.Runtime.DynamicType[]" IsCollection="true">
                <TypeDescriptors>
                  <TypeDescriptor TypeName="Microsoft.BusinessData.Runtime.DynamicType" Name="Node">
                    <TypeDescriptors>
                      <TypeDescriptor Name="ID" TypeName="System.String" IdentifierName="ID" />
                    </TypeDescriptors>
                  </TypeDescriptor>
                </TypeDescriptors>
              </TypeDescriptor>
            </Parameter>
          </Parameters>
          <MethodInstances>
            <MethodInstance Type="IdEnumerator" Name="ReadAllIds" DefaultDisplayName="ReadAllIds" ReturnParameterName="returnIds" Default="true">
              <Properties>
                <Property Name="RootFinder" Type="System.String">true</Property>
              </Properties>
              <AccessControlList>
                <AccessControlEntry Principal="NT AUTHORITY\Authenticated Users">
                  <Right BdcRight="Execute" />
                </AccessControlEntry>
                <AccessControlEntry Principal="NT AUTHORITY\System">
                  <Right BdcRight="SetPermissions"/>
                </AccessControlEntry>
              </AccessControlList>
            </MethodInstance>
          </MethodInstances>
        </Method>
        <!--        ChangedIdEnumerator          -->
        <Method Name="ReadIncrementalList" IsStatic="false">
          <FilterDescriptors>
            <FilterDescriptor Name="LastCrawl" Type="InputOutput">
              <Properties>
                <Property Name="SynchronizationCookie" Type="System.String">x</Property>
              </Properties>
            </FilterDescriptor>
            <FilterDescriptor Name="Timestamp" Type="Timestamp" />
          </FilterDescriptors>
          <Parameters>
            <Parameter Name="lastCrawlDate" Direction="InOut">
              <TypeDescriptor Name="LastCrawlDate" TypeName="System.DateTime" IsCollection="false" AssociatedFilter="LastCrawl">
                <Interpretation>
                  <NormalizeDateTime LobDateTimeMode="Local" />
                </Interpretation>
              </TypeDescriptor>
            </Parameter>
            <Parameter Name="returnIds" Direction="Return">
              <TypeDescriptor TypeName="Microsoft.BusinessData.Runtime.DynamicType[]" Name="Nodes" IsCollection="true" >
                <TypeDescriptors>
                  <TypeDescriptor TypeName="Microsoft.BusinessData.Runtime.DynamicType" Name="Node">
                    <TypeDescriptors>
                      <TypeDescriptor TypeName="System.String" IdentifierName="ID" Name="ID" />
                    </TypeDescriptors>
                  </TypeDescriptor>
                </TypeDescriptors>
              </TypeDescriptor>
            </Parameter>
          </Parameters>
          <MethodInstances>
            <MethodInstance Name="ReadIncrementalListInstance" Type="ChangedIdEnumerator" ReturnParameterName="returnIds" Default="true">
              <AccessControlList>
                <AccessControlEntry Principal="NT AUTHORITY\Authenticated Users">
                  <Right BdcRight="Execute" />
                  <Right BdcRight="SetPermissions" />
                </AccessControlEntry>
              </AccessControlList>
            </MethodInstance>
          </MethodInstances>
        </Method>
        <!--        DeletedIdEnumerator          -->
        <Method Name="ReadDeletedIncrementalList" IsStatic="false" DefaultDisplayName="ReadDeletedIncrementalList">
          <FilterDescriptors>
            <FilterDescriptor Name="LastCrawl" Type="InputOutput">
              <Properties>
                <Property Name="SynchronizationCookie" Type="System.String">x</Property>
              </Properties>
            </FilterDescriptor>
            <FilterDescriptor Name="Timestamp" Type="Timestamp" />
          </FilterDescriptors>
          <Parameters>
            <Parameter Name="LastCrawlDate" Direction="InOut">
              <TypeDescriptor Name="LastCrawlDate" TypeName="System.DateTime" IsCollection="false" AssociatedFilter="LastCrawl">
                <Interpretation>
                  <NormalizeDateTime LobDateTimeMode="Local" />
                </Interpretation>
              </TypeDescriptor>
            </Parameter>
            <Parameter Name="deletedIds" Direction="Return">
              <TypeDescriptor  TypeName="Microsoft.BusinessData.Runtime.DynamicType[]" Name="Nodes" IsCollection="true">
                <TypeDescriptors>
                  <TypeDescriptor TypeName="Microsoft.BusinessData.Runtime.DynamicType" Name="Node">
                    <TypeDescriptors>
                      <TypeDescriptor Name="ID" TypeName="System.String" IdentifierName="ID" />
                    </TypeDescriptors>
                  </TypeDescriptor>
                </TypeDescriptors>
              </TypeDescriptor>
            </Parameter>
          </Parameters>
          <MethodInstances>
            <MethodInstance Name="ReadDeletedIncrementalListInstance" Type="DeletedIdEnumerator" ReturnParameterName="deletedIds">
              <AccessControlList>
                <AccessControlEntry Principal="NT AUTHORITY\Authenticated Users">
                  <Right BdcRight="Execute" />
                  <Right BdcRight="SetPermissions" />
                </AccessControlEntry>
              </AccessControlList>
            </MethodInstance>
          </MethodInstances>
        </Method>

        <!--        Finder          -->
        <Method Name="ReadAllItems" DefaultDisplayName="ReadAllItems" IsStatic="false">
          <Parameters>
            <Parameter Name="returnAllItems" Direction="Return">
              <TypeDescriptor TypeName="Microsoft.BusinessData.Runtime.DynamicType[]" Name="Nodes" IsCollection="true" >
                <TypeDescriptors>
                  <TypeDescriptor TypeName="Microsoft.BusinessData.Runtime.DynamicType" Name="Node">
                    <TypeDescriptors>
                      <TypeDescriptor TypeName="System.String" IdentifierName="ID" Name="ID" />
                      <TypeDescriptor TypeName="System.String" Name="Name" />
                      <TypeDescriptor TypeName="System.String" Name="Title" />
                      <TypeDescriptor TypeName="System.String" Name="Path" />
                    </TypeDescriptors>
                  </TypeDescriptor>
                </TypeDescriptors>
              </TypeDescriptor>
            </Parameter>
          </Parameters>
          <MethodInstances>
            <MethodInstance Type="Finder" Name="ReadAllItems" DefaultDisplayName="ReadAllItems" ReturnParameterName="returnAllItems" Default="true" ReturnTypeDescriptorName="Nodes" ReturnTypeDescriptorLevel="0">
              <AccessControlList>
                <AccessControlEntry Principal="NT AUTHORITY\Authenticated Users">
                  <Right BdcRight="Execute" />
                </AccessControlEntry>
                <AccessControlEntry Principal="NT AUTHORITY\System">
                  <Right BdcRight="SetPermissions"/>
                </AccessControlEntry>
              </AccessControlList>
            </MethodInstance>
          </MethodInstances>
        </Method>

        <!--        SpecificFinder          -->
        <Method Name="ReadItem" DefaultDisplayName="ReadItem" IsStatic="false">
          <Parameters>
            <Parameter Direction="In" Name="ID">
              <TypeDescriptor TypeName="System.String" IdentifierName="ID" Name="ID" />
            </Parameter>
            <Parameter Direction="Return" Name="returnParameter">
              <TypeDescriptor TypeName="Microsoft.BusinessData.Runtime.DynamicType" Name="Node">
                <TypeDescriptors>
                  <TypeDescriptor TypeName="System.String" IdentifierName="ID" Name="ID" ReadOnly="true" />
                  <TypeDescriptor TypeName="System.String" Name="Title" />
                  <TypeDescriptor TypeName="System.String" Name="Author" />
                </TypeDescriptors>
              </TypeDescriptor>
            </Parameter>
          </Parameters>
          <MethodInstances>
            <MethodInstance Type="SpecificFinder" ReturnParameterName="returnParameter" ReturnTypeDescriptorName="Node" Default="true" Name="ReadItem" DefaultDisplayName="ReadItem"  ReturnTypeDescriptorLevel="0">
              <AccessControlList>
                <AccessControlEntry Principal="NT AUTHORITY\Authenticated Users">
                  <Right BdcRight="Execute" />
                </AccessControlEntry>
                <AccessControlEntry Principal="NT AUTHORITY\System">
                  <Right BdcRight="SetPermissions"/>
                </AccessControlEntry>
              </AccessControlList>
            </MethodInstance>
          </MethodInstances>
        </Method>
      </Methods>
    </Entity>
  </Entities>
</LobSystem>

What I'm doing wrong? I would really appreciate any input.

Mitka
  • 51
  • 4

2 Answers2

0

You have the same name for your SynchronizationCookie ("x"), give a different cookie name to each of your methods

0

I encountered similar issue recently (SpecificFinder not called) in my custom BCS connector and managed to sort it out. In my scenario I have two entities (parent and child), and SpecificFinder was called only for parent entities but was not called for the child ones. It turned out that the issue was related to the way I constructed "access URIs". Initially the URIs were like this:

<protocol>://<entity_name>/<entity_id>

And my start URL (specified in the content source definition) was an URL of a "fake" parent entity (without any ID):

<protocol>://<parent_entity_name>

But it seems that SharePoint crawler treats access URIs in the same way as web URLs, and applies a filter by the URL path specified in the content source definition. In other words, in my case, it would only crawl URIs corresponding to the following pattern:

<protocol>://<parent_entity_name>/*

After I changed my access URI format to

<protocol>://root/<entity_name>

and set my start URL in the content source definition to

<protocol>://root

everything started working properly.

johnnyjob
  • 380
  • 1
  • 9