Copied to clipboard

Flag this post as spam?

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


  • JS 3 posts 23 karma points
    May 08, 2013 @ 17:24
    JS
    0

    XSLTsearch not searching additional specified properties

    I'm trying to search multiple properties on my site, but the only field that I'm getting results from is bodyText. Here is my macro:

    <umbraco:Macro runat="server" Alias="XSLTsearch" macroAlias="XSLTsearch" source="-1" searchFields="@nodeName,metaKeywords,metaDescription,bodyText,sidebarContent" previewFields="bodyText,sidebarContent,metaDescription" previewType="beginning" searchBoxLocation="bottom" resultsPerPage="5" previewChars="255" showPageRange="0" showOrdinals="0" showScores="0" showStats="1"></umbraco:Macro>

    To keep things simple, I've removed the majority of my fields and have only left "sidebarContent". I'm still not getting any search results from that field. Can someone please advise? Thanks.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 08, 2013 @ 17:45
    Douglas Robar
    0

    What you have in the searchFields= parameter looks fine -- assuming sidebarContent is the alias of the document type property you want to search within and that's the proper casing of the alias.

    A few questions...

    1. Do you get any results for any searches? For instance, if you search for the letter A, do any pages get found? If not, that's the problem and not the sidebarContent field per se. Once we get search working in general adding the sidebarContent field should be a piece of cake.

    2. What is the data type associated with the sidebarContent property? And do you have published pages with content in that field? XSLTsearch only looks in published content.

    cheers,
    doug. 

  • JS 3 posts 23 karma points
    May 08, 2013 @ 17:54
    JS
    0

    Hi Doug,

    Thanks for the quick response! Yes, the casing on the sidebarContent alias is correct. I'm also getting search results, but they're only returning results from bodyText. The data type for the sidebarContent field is an RTE, just like bodyText, and I have two published pages using that field. It's a bit odd because when I search for a word which appears only on, let's say page A, in both sidebarContent and bodyText, I'm only seeing the result for bodyText. Thanks for your help!

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 08, 2013 @ 18:12
    Douglas Robar
    0

    Thanks for the info.

    Okay, let's get a bit techie and see if we can get to the bottom of this. Can you try three things for me?

    1. Update the macro to use these parameters temporarily:

    searchFields="@nodeName,sidebarContent" previewFields="sidebarContent"

    Does that make any difference? It should find pages with the search term in the page name or in the sidebarContent field. 

    2. Search for one of the pages with sidebarContent by the name of the page. The 'about' page, for instance, or whatever you have. I want to be sure that you can find the pages in question and they aren't somehow hidden from XSLTsearch completely. Can you search and find the pages in question by their name?

    3. Open the ~/app_data/umbraco.config file (it's an xml file), and search for sidebarContent. You'll find those two published pages listed there with the content that XSLTsearch will be looking through. Is it what you expect to be there?

    cheers,
    doug. 

     

  • JS 3 posts 23 karma points
    May 08, 2013 @ 19:03
    JS
    0

    Hi Doug,

    My apologies, I realized just now that I was editing the wrong macro! I have a redirect setup (because my search is in my header) so that the search results display on a results page. I'd forgotten that I had the macro inserted on the results page rather than as a separate macro file. It works perfectly now. Thanks for your help!

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 09, 2013 @ 10:48
    Douglas Robar
    0

    No problem. Glad you got it sorted out!

    cheers,
    doug. 

Please Sign in or register to post replies

Write your reply to:

Draft