0

I need to set No for Allow items from this list to appear in search results? for my custom list, enter image description here

so I achieved this by following PowerShell scripts

//Get the list which was created
SPList spList = spWeb.Lists[Customlist];
spList.NoCrawl = true; // Not allow items to appear in search results
spList.NoCrawl = false; // Allow items to appear in search results

But I need to achieve this by XML and c#. I mean I am creating the custom list using XML and c#, I need to set that false while list creation, so I am not sure about that property name in XML. Please advise me to achieve this.

1
  • can you share the xml that you are using ? Commented Jul 28, 2017 at 8:35

1 Answer 1

1

It should be NoCrawl.

<ListTemplate
  AllowDeletion = "TRUE" | "FALSE"
  AllowEveryoneViewItems = "TRUE" | "FALSE"
  AlwaysIncludeContent = "TRUE" | "FALSE"
  BaseType = "0" | "1" | "3" |"4" | "5"
  CacheSchema = "TRUE" | "FALSE"
  Catalog = "TRUE" | "FALSE"
  Category = "Libraries" | "Communications" | "Tracking" | 
    "Custom Lists"
  Default = "TRUE" | "FALSE"
  Description = "Text"
  DisableAttachments = "TRUE" | "FALSE"
  DisallowContentTypes = "TRUE" | "FALSE"
  DisplayName = "Text"
  DocumentAsEnclosure = "TRUE" | "FALSE"
  DocumentTemplate = "Integer"
  DontSaveInTemplate = "TRUE" | "FALSE"
  EditPage = "Text"
  EnableModeration = "TRUE" | "FALSE"
  EnablePeopleSelector = "TRUE" | "FALSE"
  EnableResourceSelector = "TRUE" | "FALSE"
  FeatureId = "Text"
  FolderCreation = "TRUE" | "FALSE"
  Hidden = "TRUE" | "FALSE"
  HiddenList = "TRUE" | "FALSE"
  Image = "URL"
  MultipleTypes = "TRUE" | "FALSE"
  MustSaveRootFiles = "TRUE" | "FALSE"
  Name = "Text"
  NewPage = "Text"
  NoCrawl = "TRUE" | "FALSE"
  OnQuickLaunch = "TRUE" | "FALSE"
  Path = "Text"
  RootWebOnly = "TRUE" | "FALSE"
  SecurityBits = "Text"
  Sequence = "Integer"
  SetupPath = "Text"
  SyncType = "Text"
  Type = "Integer"
  Unique = "TRUE" | "FALSE"
  UseRootFolderForNavigation = "TRUE" | "FALSE"
  VersioningEnabled = "TRUE" | "FALSE">
</ListTemplate>

Refer https://msdn.microsoft.com/en-us/library/ms462947.aspx for more details

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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