Visual Studio Team Services Support

Computer screen showing a question mark. Community, documentation, and status update solutions.

VSTS status

We are here to help

I need help troubleshooting Code Search

Troubleshoot Code Search in Team Foundation Server

No results are shown after installing or configuring Search
  1. Wait until you are sure a sufficient time has elapsed after installing or configuring Search. It may take up to 12 hours for Search to index a collection, depending on the size and number of code files.
  2. If no results are shown after this period, contact support at the address shown at the end of this topic.
Search stops working and no results are shown Follow these steps. Replace "SearchServer" with the name of the server where Search is installed:
  1. Access the URL http://SearchServer:9200 from a web browser on a computer in the same domain as the server running Search.
    • If the status returned is 200 - OK, go to step 2.
    • If any other status is returned, contact support at the address shown at the end of this topic.
    • If you don't get a response, verify that the elasticsearch-service-x64 service is running on the server where Search is configured. If the service is stopped, start it and access the Search server again. If you still get no response, or a response other than 200 - OK, contact support at the address shown at the end of this topic.
  2. If the status is 200, access the URL http://SearchServer:9200/_cat/health?v from a web browser on a computer in the same domain as the server running Search.
    • If the status column shows green/OK, and Search is still not working, contact support at the address shown at the end of this topic.
    • If the status column shows red/fault, look at the value in the init or unassigned columns. If these are greater than zero, wait for 30 minutes and then repeat this step. If the values are unchanged, go to step 3.
  3. Access the URL http://SearchServer:9200/_cat/shards?v from a web browser on a computer in the same domain as the server running Search.
    • Make a note of the values in the Shard column for the rows with a state value of unassigned and contact support at the address shown at the end of this topic.
Search does not show the expected results
  1. If the files were added in the last few minutes, wait for ten minutes or so while they are indexed.
  2. If the files are still not shown in the results, re-index the repository or collection where the files are located.
Search shows outdated results
  1. If the files were added in the last few minutes, wait for ten minutes or so while they are indexed.
  2. If the files are still not shown in the results, re-index the repository or collection where the files are located.
TFS server overall performance is affected
  1. Stop all indexing and see if performance recovers.
  2. If performance does recover, consider locating Code Search on a separate server if you have not already done so.
Elasticsearch causes Search installation failure If the Elasticsearch service cannot be installed, you will see an error such as Search cannot be installed since elasticsearch-x64 already exists. Use the following steps to resolve this:
  • Check that the folder you specified for the search index is completely empty, or choose a different (empty) folder.
  • If Search was previously configured, remove all remnants by executing the following command from an administrative Command Prompt: sc delete elasticsearch-service-x64
  • If Search has not been configured before on this server, check if there is an existing standard version of the Elasticsearch service installed (rather than the version provided with TFS). If so, follow the steps described in the Elasticsearch documentation to remove it.

See also

🗨 Need a fast response? Chat with our support bot

Bot is currently in beta and can help answer configuration, build, and release questions. Help us improve the experience by answering the survey after your chat.

Contact us!