Export (0) Print
Expand All

CodeIndex Command

Visual Studio 2013

Use the CodeIndex command to manage code indexing on Team Foundation Server. For example, you might want to reset the index to fix CodeLens information, or turn off indexing to investigate server performance issues.

Required Permissions

To use the CodeIndex command, you must be a member of the Team Foundation Administrators security group. See Team Foundation Server permissions.

Note Note

Even if you log on with administrative credentials, you must open an elevated Command Prompt window to run this command. You must also run this command from the application tier for Team Foundation.

TFSConfig CodeIndex {/indexingStatus | /setIndexing:{ on | off | keepupOnly } | /ignoreList:{ add | remove | removeAll | view } ServerPath | /listLargeFiles [/fileCount:FileCount] [/minSize:MinSize] | /reindexAll | /destroyCodeIndex [/noPrompt]} {/CollectionName:CollectionName | /CollectionId:CollectionId}

Argument

Description

CollectionName

Specifies the name of the team project collection. If the name has spaces, enclose the name with quotation marks, for example, "Fabrikam Web Site".

CollectionId

Specifies the identification number of the team project collection.

ServerPath

Specifies the path to a code file.

Option

Description

/indexingStatus

Show the status and configuration of the code indexing service.

/setIndexing:{ on | off | keepupOnly }

  • on: Start indexing all changesets.

  • off: Stop indexing all changesets.

  • keepupOnly: Stop indexing previously created changesets and start indexing new changesets only.

/ignoreList:{ add | remove | removeAll | view } ServerPath

You can use the wildcard character (*) at the start, end, or both ends of the server path.

Specifies a list of code files and their paths that you don't want indexed.

  • add: Add the file that you don't want indexed to the ignored file list.

  • remove: Remove the file that you want indexed from the ignored file list.

  • removeAll: Clear the ignored file list and start indexing all files.

  • view: See all the files that aren't being indexed.

/listLargeFiles [/fileCount: FileCount /minSize: MinSize]

Shows the specified number of files that exceeds the specified size in KB. You can then use the /ignoreList option to exclude these files from indexing.

For this, you'll need Team Foundation Server 2013 with Update 3.

/reindexAll

Clear previously indexed data and restart indexing.

/destroyCodeIndex [/noPrompt]

Delete the code index and remove all indexed data. Does not require confirmation if you use the /noPrompt option.

/CollectionName: CollectionName

Specifies the name of the team project collection on which to run the CodeIndex command. Required if you don't use /CollectionId.

/CollectionId: CollectionId

Specifies the identification number of the team project collection on which to run the CodeIndex command. Required if you don't use /CollectionName.

Note Note

The example companies, organizations, products, domain names, email addresses, logos, people, places, and events depicted herein are fictitious.  No association with any real company, organization, product, domain name, email address, logo, person, places, or events is intended or should be inferred.

To see the code indexing status and configuration:

TFSConfig CodeIndex /indexingStatus /CollectionName:"Fabrikam Web Site"

To start indexing all changesets:

TFSConfig CodeIndex /setIndexing:on /CollectionName:"Fabrikam Web Site"

To stop indexing previously created changesets and start indexing new changesets only:

TFSConfig CodeIndex /setIndexing:keepupOnly /CollectionName:"Fabrikam Web Site"

To find up to 50 files that are larger than 10 KB:

TFSConfig CodeIndex /listLargeFiles /fileCount:50 /minSize:10 /CollectionName:"Fabrikam Web Site"

To exclude a specific file from indexing and add it to the ignored file list:

TFSConfig CodeIndex /ignoreList:add "$/Fabrikam Web Site/Catalog.cs" /CollectionName:"Fabrikam Web Site"

To see all the files that aren't indexed:

TFSConfig CodeIndex /ignoreList:view

To clear previously indexed data and restart indexing:

TFSConfig CodeIndex /reindexAll /CollectionName:"Fabrikam Web Site"

To delete the code index with confirmation:

TFSConfig CodeIndex /destroyCodeIndex /CollectionName:"Fabrikam Web Site"
Show:
© 2014 Microsoft