We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36467
    • 73 Posts
    I was using advanced search plugin for last few years, recently we noticed that it's returning irrelevant results, I tried changing some options so that it will return exact search results matching with "pagetitle" only and not contents, but no luck. I also tried simple search plugin, If I search something like "lorem ipsum dollar" then it returns resources who have "lorem" in pagetitle OR content + resources with "ipsum" in pagetitme or content + "dollar" and so on.

    What I want is simply a resource having these exact 3 words alongside

    below are the snippet calls i used.

    [[!AdvSearch?
        &withFields = `pagetitle,longtitle` 
        &extractLength=`220`
        &hideContainers=`1`
        &queryHook=`ArticleSearchQHook` 
        &extractEllipsis=`.`  
        &contexts=`web,tech,live`  
        &tpl=`articleSearchResult2017`   
        &perPage=`10`  
        &minChars=`2`  
        &withTVs=`docGroup,post_category,post_subcategory,category,Authorsname, Upload article image`  
        &fields=`pagetitle,longtitle,description,introtext,content,publishedon` 
    ]]


    [[!SimpleSearch? 
        &highlightTag=`strong` 
        &perPage=`15`
        &useAllWords=`1` 
        &depth=`3` 
        &searchStyle=`match` 
        &includeTVs=`1` 
        &processTVs=`1` 
        &docFields=`pagetitle` 
        &pagingSarator=` ` 
        &matchWildcard=`false` 
        &andTerms=`false`
    ]]
    


      • 3749
      • 24,544 Posts
      Does putting quotes around the search term help?

      Where, exactly, do you want to search?

      Will all searches be for the exact phrase, or just some?
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 36467
        • 73 Posts
        Does putting quotes around the search term help? => It didn't help, both snippets still return results with resources having word "python" and "programming" in pagetitle as well as in contents. I want it to return resources with a title like "learn python programming", "python programming crash course", "getting started with Python programming".

        Where, exactly, do you want to search? => I want to search for all resources tree, I even tried to limit the search for 1 parent only, but still, results were not as expected

        Will all searches be for the exact phrase, or just some? => It will be mixed I guess, user might enter just "python" or phrase like "python programming" it should return results in both case.
          • 3749
          • 24,544 Posts
          It's difficult to have it both ways since apparently neither extra will respond to quotation marks around the search phrase.

          Did you try the MODX Manager's search in the upper left of the Manager?

          I've been thinking about developing a custom search form that lets the user specify where to search and select an exact versus loose search strategy, but I don't know when I'll have time to do it.

            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting