Monday 1 January 2018

Configure Search Service for TFS 2018 in a Separate Server to Enable Work Item & Code Search

Work Item Search & Code Search allow TFS users to do advanced and dynamic way of quick searching on code or work items, with drill down etc. To enable Code Search in VSTS you have to install the Marketplace extension for code search, work item search is default enabled for VSTS. You can configure search for on-premises TFS in TFS AT (described here), itself. But if you want to setup search service in a separate box from your TFS AT, you can follow the steps described in this post.

First download and install Java Runtime Environment 8 (JRE) update 20 or higher to the machine you are configuring as search server. The set the JAVA_HOME to the installed location.01

In your TFS 2018 AT go to Admin Console and launch Search configuration wizard. Select the option for “Use an existing Search Service”. Click on the provided link to locate the search service package available in your TFS AT.02

Copy zip folder contents to a folder in your search server.image

README.txt contains the information you need to configure the search service. In a administrative PowerShell window run the script Configure-TFSSearch.ps1  providing install path and search index path. It is recommended to have 35% of all collection DBs size or more hard disk space in index path.

.\Configure-TFSSearch.ps1 -Operation install -TFSSearchInstallPath C:\ES -TFSSearchIndexPath C:\ESDATA -
Port 920004

Once the installation script completes you can find the search service url as shown in above figure. Copy that and paste it in the search configuration wizard in your TFS AT.05

Click next and in the next step select both the options to install code search for existing and any new collections that will be created later.06

When you run the readiness checks you might encounter an issue due to firewall blocking the search service port you have configured. Allow that port only for the requests coming from your TFS AT by creating a custom firewall rule.08


The readiness checks should pass and the search service configuration should complete successfully.12

Code search and work item search will be available for the TFS instance. You can switch between them using the small dropdown.




Searching will be possible once the index building completed.16


Anonymous said...

Have you experienced any issues with configuring code search for TFS 2018 update 3?
I have been testing TFS 2018 update 3 in STG and when trying to configure codesearch (separate server) we are experiencing problems? please share your thoughts.

Appreciated thank you!

Chaminda Chandrasekara said...

I have experienced issues if I try to setup Search Server by letting the installer to auto install java runtime. If the java runtime is installed before installing search server no issues encountered. But did not try TFS 2018 update 03. If you have run into any specific issues let me know by posting here so I can give it a try to reproduce.

Popular Posts