Copied to clipboard

Flag this post as spam?

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


  • Owen Hope 119 posts 140 karma points
    Oct 17, 2011 @ 18:47
    Owen Hope
    0

    Search giving me odd results

    Hello,

    I installed XSLTsearch and it is working fairly well, however some of my search results are not being returned properly.

    For instance:

    I have a node named "Acai" with a property "commonName" with the value "Acai" - I added this to searchFields in the template.

    If I try and search "Acai" it works properly and finds my page.

    However, I have the same type of document named "Salt" but when I search Salt it does not find this entry? The same thing happends when I try searching "Pepper". This is also occuring in multiple other document types.

    Any suggestions/help would be great.

     

    Owen

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 17, 2011 @ 18:57
    Fuji Kusaka
    0

    Hi Owen,

    In your template where you added the macro make sure you added the document type you want XSLTSearch to search for this text. Like for example if "Salt" is a text in your RTE called bodyText or any other document type add it to your macro.

     <form method="get" action="search.aspx?">
                      <umbraco:Macro source="-1" searchFields="@nodeName,mainBodyText,metaDescription,metaKeywords,moreContent" previewFields="mainBodyText,metaDescription" searchBoxLocation="None" previewType="Beginning" resultsPerPage="10" previewChars="225" showPageRange="1" showOrdinals="1" showScores="0" showStats="0" Alias="XSLTsearch" runat="server" />
      </form>

     

    Hope this helps

  • Owen Hope 119 posts 140 karma points
    Oct 17, 2011 @ 19:02
    Owen Hope
    0

    Hi Fuji,

    Thanks for your reply.

    I went through and added all my neccessary fields:

    <umbraco:Macro runat="server" Alias="XSLTsearch"
              macroAlias="XSLTsearch"
              source="-1"
              searchFields="@nodeName,mainContent,pageTitle,eventTitle,eventTeaser,newsHeading,recipeName,difficultyRating,numberOfServings,preperationTime,cookTime,ingredients,methodology,recipeAuthor,commonName,latinName,family,countryOfOrigin,body,videoTitle,videoDescription,recipeCategories"
              previewFields="mainContent,pageTitle,eventTitle,eventTeaser,newsHeading,recipeName,difficultyRating,numberOfServings,preperationTime,cookTime,ingredients,methodology,recipeAuthor,commonName,latinName,family,countryOfOrigin,body,videoTitle,videoDescription,recipeCategories"
              previewType="beginning"
              searchBoxLocation="none"
              resultsPerPage="5"
              previewChars="255"
              showPageRange="0"
              showOrdinals="0"
              showScores="0"
              showStats="1"
              showDebug="1">
            </umbraco:Macro>

    What's wierd is that it is picking up "Acai" from the commonName field for that node, but it won't pick up "Salt" which is the same document type, same field "commonName" etc..

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 17, 2011 @ 19:08
    Fuji Kusaka
    0

    Hey Owen,

    This "Salt" text you are looking for is it in the same Node? Or is it in another Node?May be could change this piece of line in your XSLT Search

     

    <xsl:whentest="number($source)= -1 or number($source)= 0">
            <!-- using ALL nodes -->
            <xsl:call-templatename="search">
              <!-- searches absolutely all pages (useful if you want to search multiple sites at once, or if you do not have all your content pages below a common homepage node in the content tree)        -->  
             
    UnComment this part
             <xsl:with-paramname="items"select="umbraco.library:GetXmlAll()/*"/>
              Comment this part        

             <!--  searches all pages within a specific site (useful if you have multiple sites in one umbraco installation)
              <xsl:with-param name="items" select="$currentPage/ancestor-or-self::* [@level = '1']"/>-->
            </xsl:call-template>
          </xsl:when>

     

     

  • Owen Hope 119 posts 140 karma points
    Oct 17, 2011 @ 19:22
    Owen Hope
    0

    Hi Fuji,

    Unfortunately that didn't work.

    Acai and Salt are two different nodes of the same document type.

    Here is a screenshot to better describe my node structure.

     

    The alphabetical parent folders of these "Spices" have no template and are for organizational purposes only.

    Cheers,

    Owen

     

  • Fuji Kusaka 2203 posts 4220 karma points
    Oct 17, 2011 @ 19:47
    Fuji Kusaka
    0

    Thats weird in any case it should be able to look for  any of those Node "Acai, AA pepper etc" since they are all using the same Document Type. What if you search for "Salt" from another page.

    <umbraco:Macro 
    source
    ="-1" 
    searchFields
    ="@nodeName,mainContent,pageTitle,eventTitle,eventTeaser,newsHeading,recipeName,difficultyRating,numberOfServings,preperationTime,cookTime,ingredients,methodology,recipeAuthor,commonName,latinName,family,countryOfOrigin,body,videoTitle,videoDescription,recipeCategories
    "
    previewFields="mainContent,pageTitle,eventTitle,eventTeaser,newsHeading,recipeName,difficultyRating,numberOfServings,preperationTime,cookTime,ingredients,methodology,recipeAuthor,commonName,latinName,family,countryOfOrigin,body,videoTitle,videoDescription,recipeCategories" 
    searchBoxLocation
    ="None"
    previewType="Beginning" 
    resultsPerPage
    ="10" 
    previewChars
    ="225" 
    showPageRange
    ="1"
    showOrdinals="1" 
    showScores
    ="0" 
    showStats
    ="0" 
    Alias
    ="XSLTsearch" runat="server" />
                
  • Owen Hope 119 posts 140 karma points
    Oct 17, 2011 @ 19:54
    Owen Hope
    0

    Hi Fuji,


    When I search "Salt" I find it on 2 other pages, but not the "Salt" spice page.

    I tried moving around the nodes to no avail.

    I also added "Salt" to the "body" content of the same document type, and it is not being indexed either, seems to be something specific to that Document Type.

     

    Owen

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 18, 2011 @ 09:45
    Douglas Robar
    0

    Hi, Owen,

    What version fo XSLTsearch are you using? I fixed a bug that sounds suspiciously like this one in a recent release. Can you try v3.0.3 if you're not already using it?

    cheers,
    doug. 

  • Owen Hope 119 posts 140 karma points
    Oct 18, 2011 @ 18:27
    Owen Hope
    0

    Hi Doug,

    When I look under Developer/Packages/Installed Packages/XsltSearch it says Package version: 3.03 .. so I am guessing I am up to date.

    Any other suggestions?

    Owen

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 19, 2011 @ 11:10
    Douglas Robar
    0

    Super. 

    I just posted XSLTsearch 3.0.4 and it has another fix for an odd situation. Can you install the upgrade package and try your searches again?

    If it still doesn't work, maybe I can log in to your site to see what's going on, or get a copy of your site (NDA'd if needed) so that I can reproduce the issue and either explain what's going on or work on a fix?

    Let me know how 3.0.4 works for you.

    cheers,
    doug. 

  • Owen Hope 119 posts 140 karma points
    Oct 19, 2011 @ 18:07
    Owen Hope
    0

    Hi Doug,

    I installed the 3.0.4 update package and retried my search to no success.

    Get back to me so we can explore option 2 (log into the site) 

    Thanks again,

    Owen

     

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 19, 2011 @ 18:24
    Douglas Robar
    0

    Well, there goes the obvious things. Let's move on to "phase 2" of our plan :)

    Can you drop me a note through my website (http://www.percipientstudios.com/about/contact.aspx) with you login details for the site and I'll give it a look as soon as I can. Thanks for hanging in there, we'll get to the bottom of this!

    cheers,
    doug. 

  • Owen Hope 119 posts 140 karma points
    Oct 19, 2011 @ 18:29
    Owen Hope
    0

    Done,

    Thanks!

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 20, 2011 @ 16:04
    Douglas Robar
    1

    Thanks, Owen, for the login!

    I've found the cause of some pages (your spice pages) not showing up in search results... you have the umbracoNaviHide property set on the 'salt' page as well as its parent 's' page. XSLTsearch automatically keeps hidden pages from appearing in the search results.

    Now if you're thinking that's doing double-duty with the umbracoNaviHide flag you'd be correct. In your case I'd suggest you make another property on your docTypes called 'umbracoSearchHide' or similar. You'd use it just as you do the umbracoNaviHide flag but it would only have the effect of keeping pages from appearing in the search results (such as the 's' page).

    Once you've done that you'll want to modify how XSLTsearch works by opening the /xslt/xsltsearch.xslt file and changing the single instance of umbracoNaviHide on line 166 in the "possibleNodes" variable to your new docType property's alias (umbracoSearchHide, if you used that alias).

    And then, as they say here in the UK... "Bob's your uncle!" Or, from my American roots... "You're golden!" :)

    cheers,
    doug. 

  • Owen Hope 119 posts 140 karma points
    Oct 20, 2011 @ 18:29
    Owen Hope
    0

    Thanks Doug! I made the changes and it's working perfectly. Thank you very much for the support.

    Your'e the best!

    Cheers,

    Owen

Please Sign in or register to post replies

Write your reply to:

Draft