Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to index a column in a list with powershell.

I have a problem, when i retrieve the list how can i set what field should be put to index? Is there a special command, can anyone provide me with example or give me a hint how to implement it.

Thanks

share|improve this question

1 Answer 1

up vote 3 down vote accepted

If I understand correctly you can retrieve field form filed collection of a list and set Indexed property to true

$spField = $spList.Fields["FieldName"]
$spField.Indexed = $true
$spField.Update()
share|improve this answer
    
why you say spTextField.Update? what is spTextFIeld? –  Shkipper Mar 28 '12 at 13:20
    
sorry, I did mistake. I updated my unswer ) –  Alexander Mar 28 '12 at 13:22
    
Hi, Is it possible to make attachments column in a list "NOT indexable"? if yes can you please post a script? including getting reference to that list. –  Varun Verma Dec 19 '13 at 6:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.