Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7083461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:10:51+00:00 2026-05-28T07:10:51+00:00

I’m developing Sharepoint Search with own Content Source. And I have my crawl properties

  • 0

I’m developing Sharepoint Search with own Content Source. And I have my crawl properties and my managed properties and mapping between them accordingly.
Also I have dynamic properties, e.g. the user can change the set of properties to crawling,therefore I make it at runtime from Sharepoint Central Administration.
I’m using the following code to do that:

    private static void CreateProperty(string propertyName, Category category, ManagedPropertyCollection managedProperties)
    {
        var crawledProperty = category.CreateCrawledProperty(propertyName, false, Constants.CategoryId, 31);
        crawledProperty.IsMappedToContents = true;
        SetMapping(crawledProperty, managedProperties);
        crawledProperty.Update();
    }

    private static void SetMapping(CrawledProperty cProp, ManagedPropertyCollection managedProperties)
    {
        ManagedProperty mProp = managedProperties.Create(cProp.Name, ManagedDataType.Text);
        mProp.EnabledForScoping = true;
        Mapping newMapping = new Mapping(cProp.Propset, cProp.Name, cProp.VariantType, mProp.PID);
        MappingCollection mappings = mProp.GetMappings();
        mappings.Add(newMapping);
        mProp.SetMappings(mappings);
        mProp.EnabledForScoping = true;
    }

The static properties adds while installation, the dynamic properties adds manualy at Central Administration.
I’m using the same code to add properties while installation and setting manualy at Central Administration.

The problem is the value of Sharepoint flag “Included in index” for crawl properties. In the case, when the installation has been completed, the value of this flag is TRUE (yes) for all static crawl properties. Otherwise, for dynamic properties this flag is FALSE (no). I need to have always checked flag “Included in index” .

As I know, the property IsMappedToContents of CrawlProperty class is responsable to “Included to index” value, but it doesn’t work for me!

Do you have any idea to do that? And what I do wrongly?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:10:52+00:00Added an answer on May 28, 2026 at 7:10 am

    I found of the problem. It is sharepoint stupid tricks!
    The main trouble is sharepoint has cache of object instances.
    Lets see, I wrote the sample how to update crawl property IsMappedToContents property value programmatically.

    foreach (CrawledProperty crawledProperty in category.GetAllCrawledProperties())
    {
       crawledProperty.IsMappedToContents = true;
       crawledProperty.Update();
    }
    

    You MUST use fresh instance of crawledProperty variable! If you write something like this:

    CrawledProperty crawledProperty = category.CreateCrawledProperty(...);
    crawledProperty.IsMappedToContents = true;
    crawledProperty.Update();
    

    You FAILED!

    So, always use category.GetAllCrawledProperties() instances of crawled properties to change this property.

    PS: IsMappedToContents responsibles for “Included in index” checkbox in the Sharepoint.
    *PS2: this stuff works with Sharepoint 2007, as I know Sharepoint 2010 doesn’t have similar troubles with caching instances!*

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.