Last + First name searches in Lync/SfB Address Book (GalContacts.db)

In a previous post in Joe Calev’s WebLog, we were shown how to enable Last + First name searches in Lync Server:

That workaround works for WebSearchAndFileDownload and FileDownloadOnly — what we basically need is the GalContacts.db file.

Recently, Joe Calev’s workaround was introduced in Lync Server 2013 (Nov 2014 Cumulative Update) and it is also present in the Skype for Business Server 2015 RTM version. For the Lync Server 2010 pools, we need to follow Joe Calev’s post.

The RtcAbAttributeIndexRules.xml file is located — in a default Lync/Skype4B Server installation — in the following folders:

Lync Server 2010
C:\Program Files\Microsoft Lync Server 2010\Server\Core

Lync Server 2013
C:\Program Files\Microsoft Lync Server 2013\Server\Core

Skype for Business Server 2015
C:\Program Files\Skype for Business Server 2015\Server\Core

In Joe Calev’s post, we are proposed to use the following:

<attribute name="displayName">
	<indexRules>
		<indexRule id="displayName_rule_01">
			<description>
				<![CDATA[
          Index displayName as-is
        ]]>
			</description>
			<valuePattern>
				<![CDATA[^.*$]]>
			</valuePattern>
			<indexValues>
				<indexValue>
					<![CDATA[$0]]>
				</indexValue>
			</indexValues>
		</indexRule>
		<indexRule id="displayName_rule_02">
			<description>
				<![CDATA[
          Handle last name first name searches
      ]]>
			</description>
			<valuePattern>
				<![CDATA[(.+)(\s+)(.+)]]>
			</valuePattern>
			<indexValues>
				<indexValue>
					<![CDATA[$3 $1]]>
				</indexValue>
			</indexValues>
		</indexRule>
	</indexRules>
</attribute>

However, the final version is:

<attribute name="displayName">
	<indexRules>
    	<indexRule id="displayName_rule_01">
			<description>
	            <![CDATA[
	              Index displayName as-is
	            ]]>
          	</description>
			<valuePattern>
        		<![CDATA[^.*$]]>
			</valuePattern>
			<indexValues>
				<indexValue>
					<![CDATA[$0]]>
				</indexValue>
			</indexValues>
		</indexRule>
		<indexRule id="displayName_rule_02">
			<description>
            	<![CDATA[
		             Allow search without middle name
        	    ]]>
          	</description>
			<valuePattern>
				<![CDATA[^([^\s]+).*\s([^\s]+)$]]>
			</valuePattern>
			<indexValues>
            	<indexValue>
					<![CDATA[$1 $2]]>
				</indexValue>
			</indexValues>
		</indexRule>
		<indexRule id="displayName_rule_03">
			<description>
				<![CDATA[
					Handle last name first name searches
				]]>
			</description>
			<valuePattern>
				<![CDATA[(.+)(,+)(.+)]]>
			</valuePattern>
			<indexValues>
				<indexValue>
					<![CDATA[$3 $1]]>
				</indexValue>
			</indexValues>
		</indexRule>
	</indexRules>
 </attribute>

The main difference is that we have an additional rule to allow search without a middle name:

<indexRule id="displayName_rule_02">
          <description>
            <![CDATA[
              Allow search without middle name
            ]]>
          </description>
          <valuePattern>
            <![CDATA[^([^\s]+).*\s([^\s]+)$]]>
          </valuePattern>
          <indexValues>
            <indexValue>
              <![CDATA[$1 $2]]>
            </indexValue>
          </indexValues>
        </indexRule>

This will work wherever you have a Display Name like ‘Paulino’, ‘David’ or ‘David Paulino’ in the Active Directory.

Here are some examples:

Display Name: Augustus Cole

AddressBookFLN01

AddressBookFLN02

Display Name: High Priest Skorge

AddressBookFLN03

AddressBookFLN04

Display Name: Carmine, Benjamin

AddressBookFLN07

AddressBookFLN08

Display Name: Carmine, Anthony (COG)

AddressBookFLN05

AddressBookFLN06

Advertisement

One thought on “Last + First name searches in Lync/SfB Address Book (GalContacts.db)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.