Copied to clipboard

Flag this post as spam?

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


  • Hayward Penny III 3 posts 73 karma points
    May 24, 2018 @ 22:31
    Hayward Penny III
    0

    How to search specific folders

    I want for the search engine to just search .pdfs or within my media folder. Is that possible?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 25, 2018 @ 09:41
    Douglas Robar
    0

    Hi, Hayward,

    XSLTsearch doesn't search within the media section. Do look at ezSearch, though, it's the successor to XSLTsearch and can search within the media section as well as content.

    https://our.umbraco.org/projects/website-utilities/ezsearch/

    cheers,
    doug.

  • Hayward Penny III 3 posts 73 karma points
    May 25, 2018 @ 21:39
    Hayward Penny III
    0

    It actually does find all of my files in my media section. I do get some pdfs. However, i wanted to limit it to just pdfs and not webpages, etc.

    Also I am not able to do any upgrades on this clients site so i was trying to make this work.

    In my template it has the following

              <umbraco:Macro Alias="SiteSearch" runat="server" />
              <!--<umbraco:Macro runat="server" Alias="SiteSearch"
                  source="1065" 
                  searchFields="@nodeName,metaKeywords,metaDescription,description,summary,content,title"
                  previewFields="description,summary,metaDescription"
                  previewType="beginning"
                  searchBoxLocation="bottom"
                  resultsPerPage="10"
                  previewChars="255"
                  showPageRange="0"
                  showOrdinals="0"
                  showScores="0"
                  showStats="0"></umbraco:Macro>-->
    

    It looks like the change would be in the source option but i don't know my choices of what to put in. The documentation says "-1" is the default. But what are my other options?

    Thanks for your help so far.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    May 27, 2018 @ 18:27
    Douglas Robar
    2

    Hi, Hayward,

    I understand your hesitance to change the site. EzSearch is meant to be a nearly drop-in replacement for XSLTsearch but you'd need to spend a little time ensuring it worked exactly as you wanted and the output was the same (css classes would probably need name changes). Not a lot of work, probably 15-60 minutes.

    The issue with XSLTsearch is that it only searches within content nodes. It can't search media directly. If PDFs are showing up in search results with XSLTsearch it's because they are stored or referenced in content pages.

    You can search for more than one term at a time. If you get results that include PDFs when searching for example 'products' and you want to limit the results to only those 'products' that also include 'pdf' you could search for 'products pdf'. When you search for multiple terms the results will only show that that contain all the terms.

    So that might be your simple solution: tell users to include the 'pdf' term in their searches. Or create a separate search form that, upon its submission, adds the 'pdf' term to the search field automatically.

    As for the 'source' item in the macro parameters... that is used to limit where in the content tree the search should look. -1 means look at every content item no matter where it is. This is the most common.

    If you had, for instance, a section of the content tree that contained all the documentation for your products you might limit XSLTsearch to look only within that documentation sections of the content tree. If the 'documentation' page had an ID of 2345 you'd set the source parameter to that ID number, 2345 and only the documentation page and pages below it would be searched.

    The parameters are explained in more detail in the XSLTsearch 3.0 documentation at https://our.umbraco.org/FileDownload?id=1588.

    Hope this helps explain your options with XSLTsearch. And why I initially recommended ezSearch, because it can search within the media section directly as well.

    cheers,
    doug.

  • Hayward Penny III 3 posts 73 karma points
    Jun 04, 2018 @ 16:11
    Hayward Penny III
    0

    It looks like the solution is that there is no solution. That is why there is a new version.

Please Sign in or register to post replies

Write your reply to:

Draft