Steps

Start your Windows PowerShell on your computer.

Right click and select run as an administrator option.

Paste the script given below on PowerShell Window and click the enter button.

Check your SharePoint site feature, which will be activated successfully.
  1. Function AddIndex ()
  2. {
  3. Param ($listname,$InternalFieldName)
  4. try
  5. {
  6. Write-Host "Retriving the field $InternalFldName";
  7. $fieldToIndex =$list.Fields.GetFieldByInternalName($InternalFldName);
  8. Write-Host $fieldToIndex has been found";
  9. try
  10. {
  11. $index= $list.FieldIndexes.Item($fieldToIndex.Id)
  12. Write-Host $fieldToIndex is already indexed"
  13. }
  14. catch
  15. {
  16. $fldToIndex.Indexed = $true;
  17. $list.FieldIndexes.Add($fldToIndex);
  18. Write-Output ("The field {0} has been indexed" -f $fldToIndex.Title);
  19. }
  20. }
  21. catch
  22. {
  23. $error[0]
  24. }
  25. }