Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sheridan 10 posts 101 karma points
    Aug 11, 2016 @ 09:16
    Sheridan
    0

    Where can I find a list of the default Umbraco fields for Examine?

    Hi there,

    I've been configuring Examine for our website. The Index Set looks a little like this:

    <IndexSet SetName="ExternalIndexSet" IndexPath="Path_To_Index">
        <!-- The default Umbraco fields -->
        <IndexAttributeFields>
            <add Name="id" />
            <add Name="nodeName" />
            <add Name="updateDate" />
            <add Name="writerName" />
        </IndexAttributeFields>
        <!-- The alias of custom fields added to doctypes -->
        <IndexUserFields>
            <add Name="pageTitle" />
            <add Name="metaDescription" />
            <add Name="bannerHeading" />
            <add Name="podTitle" />
            <add Name="listingSectionHeading" />
            <add Name="newsletterHeading" />
            <add Name="blogListingHeading" />
            <add Name="heading" />
            <add Name="footerQuickLinksHeading" />
            <add Name="contactFormHeading" />
            <add Name="listItemText" />
            <add Name="repeaterText" />
            <add Name="textSection" />
            <add Name="bannerText" />
            <add Name="podText" />
            <add Name="text" />
            <add Name="outroText" />
            <add Name="alertText" />
            <add Name="categoryPageTitle" />
            <add Name="newsletterIntroduction" />
            <add Name="contactFormIntroduction" />
            <add Name="listingSectionIntroduction" />
            <add Name="introduction" />
            <add Name="categoryIntroduction" />
            <add Name="postSummary" />
            <add Name="bodyText" />
            <add Name="metaTitle" />
        </IndexUserFields>
        <!-- The alias of doctypes to search -->
        <IncludeNodeTypes>
            <add Name="Usn_Ac_GridLayoutSection_AN" />
            <add Name="Usn_Ac_Banner" />
            <add Name="Usn_Ac_Pod" />
            <add Name="Usn_Ac_TextVideoOrImageSection_AN" />
            <add Name="Usn_Sc_ListItem" />
            <add Name="Usn_Sc_RepeaterItem" />
            <add Name="Usn_Sc_ContactForm_AN" />
            <add Name="USNBlogCategory" />
            <add Name="USNBlogPost" />
            <add Name="USNStandardPagelevel1" />
            <add Name="USNAdvancedPageLevel1" />
            <add Name="USNAdvancedPageLevel2" />
            <add Name="USNBlogLandingPage" />
            <add Name="TextPage" />
        </IncludeNodeTypes>
    </IndexSet>
    

    As you can see, for some awkward reason, I need to separate the names of user fields from the default Umbraco fields. If we had built this website ourselves, that would probably be easier to determine, because the user fields would have been created manually.

    However, we used a uSkinned template and so they have created some custom fields, but we don't know which are custom fields and which are the default Umbraco fields. My question is therefore, where can I find a list of the default Umbraco fields?

    Also, this doesn't actually appear to work as it is. For example, we have specified the 'bannerHeading' field, but when searching for the text in the banner heading, we get no results. We have rebuilt the index, but that makes no difference and we do get results from other searches. Any ideas what might be going wrong in this case?

  • Lucio 24 posts 142 karma points
    Aug 11, 2016 @ 09:25
    Lucio
    0

    Not sure if this is going to be useful for you but just in case, I used to define what I want to look for defining the criteria. For example:

    string term = "test"
    
    var criteria = ExamineManager.Instance.SearchProviderCollection["ExternalSearcher"].CreateSearchCriteria();
    var crawl = criteria.GroupedOr(new string[] { "nodeName", "pageTitle", "metaDescription", "metaKeywords" }, term)
                    .Not().Field("nodeTypeAlias", "GlobalSettings")
                    .Not().Field("nodeTypeAlias", "Error")
                    .Not().Field("nodeTypeAlias", "File")
                    .Not().Field("nodeTypeAlias", "Folder")
                    .Not().Field("nodeTypeAlias", "Image")
                    .Not().Field("excludeFromSearch", "1")
                    .Compile();
    
     ISearchResults SearchResults = ExamineManager.Instance
                    .SearchProviderCollection["ExternalSearcher"]
                    .Search(crawl);
    
     IList<JsonSearchResult> results = new List<JsonSearchResult>();
    
Please Sign in or register to post replies

Write your reply to:

Draft