We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22815
    • 1,097 Posts
    This is an auto-generated support/comment thread for HyperFlexSeachForm.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    An improvement on FlexSearchForm, enabling searching such by template or document group and advanced search facilities.

    I didn’t write this, I’ve just added it on behalf of Benjamin.

    Previous thread: [Snippet] Advanced search hack for the FlexSearchForm snippet
      No, I don't know what OpenGeek's saying half the time either.
      MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
      Forum: Where to post threads about add-ons | Forum Rules
      Like MODx? donate (and/or share your resources)
      Like me? See my Amazon wishlist
      MODx "Most Promising CMS" - so appropriate!
      • 12725
      • 11 Posts
      I have installed this, set up the search results page, and still get a php parse error when I run it. The error is "Invalid argument supplied for foreach()". I’ve stared at this for hours and maybe I’m just sleepy, but I can’t seem to find the problem. Help! Thanks.
        • 3098
        • 37 Posts
        Hi,

        Could you copy the complete error message/error line ?

        What have you modified/configured ?
          • 12725
          • 11 Posts
          Thanks for the response smiley

          Here is the complete error message:

          [tt]« MODx Parse Error »
          MODx encountered the following error while attempting to parse the requested resource:
          « PHP Parse Error »

          PHP error debug
          Error: Invalid argument supplied for foreach()
          Error type/ Nr.: Warning - 2
          File: /home/uname/public_html/manager/includes/document.parser.class.inc.php(705) : eval()’d code
          Line: 690

          Parser timing
          MySQL: 0.0385 s s (4 Requests)
          PHP: 0.1644 s s
          Total: 0.2028 s s[/tt]

          Aside from changing $grabmax from 10 results per page to 20, and then back again, I haven’t done anything with the configuring in the code.

          Here’s the snippet call as it is on the page: [[HyperFlexSearchForm? &FSF_showResults=`0` &FSF_landing=`4`]]

          Here’s the call as it is on the search results page: [[HyperFlexSearchForm]]

          None of the pages are cached.

          Thanks so much for your help!
            • 16535
            • 5 Posts
            Same error here...

            I think that the problem is in the stopWords hyperChunk.

            * First the chunk must exist, and it must contain one "stop word" by line, "\n" separator.

            * Second the snippet looks for an array in the $stopWords variable, so i modified the code creating it :

            //$stopWords = implode(",", explode("\n", $modx->getChunk($hyperChunk)) );

            becomes :

            $stopWords = explode("\n", $modx->getChunk($hyperChunk));
              • 12725
              • 11 Posts
              Has anyone made any progress with this?  I did modify the stopwords hyperchunk, which got rid of the parse error, but now I get "no results found" even when there should be, as if it’s not searching the site at all?  huh  Thanks!

              Edit: never mind--I finally found the problem and now it’s working great!
                • 4295
                • 98 Posts
                FlexSearchForm was working great but I need a way to restrict which folders/content to search. I installed HyperFlexSearchForm and had the same errors as the guy in the post above me but used the same fix and got HyperFlexSearchForm working. But I can’t restrict searching to a folder and its children. I tried using the document ID in the $parentSearch =’’; but that didn’t work. I tried doing this with single quotes, double quotes, no quotes and backticks and I tried using inside the snippet call with backticks and that didn’t work either. I even tried putting comma separated docid’s in a chunk like the stopWordList. Can someone point me in the right direction? Where do you set the parent folder to restrict searching only to folders/content within that specific folder. THANKS!

                // Idea from Wendy Novianto
                // $parentSearch [ csv ]
                // Allow parent categories to be searched in
                $parentSearch = ’’;

                // $parentSearchMode [ 0 | 1 ]
                // Indicates whether we exclude or include the parent categories list
                $parentSearchMode = 1;

                When I set the $parentSearch incorrectly, it gives this error when searching.
                PHP error debug
                  Error: 	explode() [function.explode]: Empty delimiter.	 
                  Error type/ Nr.: 	Warning - 2	 
                  File: 	/Users/blahblah/Sites/manager/includes/document.parser.class.inc.php(705) : eval()'d code	 
                  Line: 	619
                
                  • 4295
                  • 98 Posts
                  Just following up to ask one last time -- Does anyone know how to set HyperFlexSearchForm to restrict its search to specificed folders? Thanks.
                    • 10903
                    • 23 Posts

                    I added the stopWordList chunk and modified the code as described above. However I still do not succeed in getting the correct results back. One way or another, there is only one page that appears in the result when I enter the title of the page in the search field.

                    The basic FlexSearchForm worked as a charm, but i cannot get the Hyper-version up-and-running.

                    Someone any ideas?

                    Many Thanks
                    Gino Lardon

                      • 3098
                      • 37 Posts
                      Hello,

                      I’m the developper of the HyperFlexSeachForm snippet.
                      It has been recently updated, so you’ll be able to test the new version soon.

                      Thanks for your interest.


                      Benjamin