Imagine Think Create Share

Office | SharePoint | Search | Architecture | Stuff
Blog - Title

January, 2011

  • Imagine Think Create Share

    The creator of this fault did not specify a Reason

    • 0 Comments

    Hi,

    Did you were developing with SharePoint 2010 and found this error when working with Search Query?

    This seems WCF service, isn't it? But you have no clue about the real problem, only a short "Property doesn't exist or is used in a manner inconsistent with schema settings" with an exception in Microsoft.Office.Server.Search.Query.InvalidPropertyException Stack = at Microsoft.Office.Server.Search.Query.FullTextSqlQueryInternal.Execute() .

    Jsut don't get mad, we found that this exception (InvalidPropertyException) is related to a managed property that doesn't exist. So you should review the query and find if there are any missing  managed properties.

    Shouldn't this error be more descriptive?

    Sure

    Bye!

  • Imagine Think Create Share

    How to add Publishing Image Field in your Search results

    • 1 Comments

    Hi,

    This has been a recurring problem in SharePoint: Although you add a publishingImage field to your layout and it gets indexed, the managed property mapped to this crawled property has no value.

    This is related to two issues:

    • Compound controls does not get indexed. Specifically only text is get indexed, and HTML is stripped out. So an image <img /> get an empty string, but summary links returns text.
    • SharePoint does not understand PublishingImage field. It may index all img.src of a page, but no specific parsing.

    There are several solutions to resolved this scenario, but all they seem too complex (ex.: create a second field and update it with the url with an event receiver). Finally we get a simple solution without changing the product ;)

    1. Create a webcontrol that will read from the current item the field value and write in the pageadditionalhead placeholder a meta tag
    2. Add the webcontrol to your page layout
    3. Run an incremental crawl to get the property
    4. Create a managed property that will be mapped to the crawled property named in uppercase as the name of the meta tag, in the Web category

    A sample of the webcontrol code:

    using System.Web.UI;
    
    using System.Web.UI.WebControls;
    using System.ComponentModel;
    using Microsoft.SharePoint.Utilities;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Publishing.Fields;

    namespace Microsoft.Services.WebControls
    {
    [DefaultProperty("Text"),
    ToolboxData("<{0}:IndexableImage runat=\"server\" />")]
    public class IndexableImage : WebControl
    {
    private static string getImageUrl(){
    ImageFieldValue imgField = null;

    if (SPContext.Current.ListItem["metaImage"] != null)
    {
    imgField = (ImageFieldValue)SPContext.Current.ListItem["metaImage"];

    if (imgField != null)
    {
    return imgField.ImageUrl;
    }
    }

    return string.Empty;
    }

    protected override void Render(HtmlTextWriter output)
    {
    output.Write("<meta");
    output.WriteAttribute("name", "metaImage");
    output.WriteAttribute("content", getImageUrl());
    output.Write("/>");
    output.WriteLine();
    }
    }
    }

    Namaste!

  • Imagine Think Create Share

    Page Layout Buttons Disabled on Ribbon

    • 2 Comments

    Hi,

    You may face that altough:

    1. You have permissions to edit the layout
    2. The page Layouts are available to be changed
    3. The page is checked out
    4. And the page "seems" to be in edit mode

    You still can't change the layout. This seems a bug, as the layout button is enable by the querystring EditMode. So try to add ControlMode=Edit parameter in the querystring, and page layout should be enabled if the prerequisites are met.

    Bye!

Page 1 of 1 (3 items)