We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7045
    • 225 Posts
    Thanks Corico, that pretty much answers all that I had questions about. And yes, I am having to use "&ids" with MYSQL. I figured it would just take all the ids if nothing was specified, like you mentioned. Either way, it is working.

    For my ZEND issue, all I have in the "docindex" folder is a file called "read.lock.file". So I guess I will need to look into getting docs indexed in that folder.

    Thanks again
      • 36540
      • 5 Posts
      Hi Coroico

      Its a great job done

      I got advSeach installed

      I dont understand how the indexation works

      I created a snippet with the indexation.php file and called that snippet from a page and when visited the page i get an error.

      Is this how you index the site or are there any different way to do it
        • 5811
        • 1,717 Posts
        Quote from: careem at Aug 25, 2011, 09:24 AM

        I dont understand how the indexation works

        I created a snippet with the indexation.php file and called that snippet from a page and when visited the page i get an error.

        Is this how you index the site or are there any different way to do it
        By default the engine parameter is 'mysql', which means that you do not have to index any files. You do as usual a direct search inside the mysql base.

        But if you would like do a search in dynamic contents, your first need to index the content of your documents. For the moment this a manual process. For doing this you need to use the indexation.php script. This is not a snippet. And you probably adapt this script to your own needs. The code is highly commented.
        To use it you need to:
        - edit the script file, modify the line 22 to specify which documents you want index (see GetIds addon for the ids parameter specification)
        - then drop the modified script file inside the root folder of your local environment
        - at the end of the execution of the script, the files/docindex repository is created of modified
        - then upload to your server this new docindex folder for using it with the "zend" parameter.

        If you don't require search in dynamic contents, prefer the "mysql" mode which provide faster searches.
        I will provide a backend module to manage the indexation of contents with the 1.0.0 pl release, but for the moment you need to do this manually.

          • 7045
          • 225 Posts
          Coroico,

          Can you confirm where to drop the script? No matter where I put it, I get errors related to pathing issues within the script.
            • 7045
            • 225 Posts
            I put the file back into my root, but I had to adjust the capitalization on line 46 to the following:

            require_once 'Zend/Search/Lucene.php';
            


            I then ran the script again. It got further, but I keep getting the following:

            Indexation starting ...
            Fatal error: Uncaught exception 'Zend_Search_Lucene_Exception' with message 'Index doesn't exists in the specified directory.' in /home/deniro03/public_html/clients/test4/assets/libraries/Zend/Search/Lucene.php:566 Stack trace: #0 /home/deniro03/public_html/clients/test4/assets/libraries/Zend/Search/Lucene.php(225): Zend_Search_Lucene->__construct('/home/deniro03/...', false) #1 /home/deniro03/public_html/clients/test4/indexation.php(175): Zend_Search_Lucene::open('/home/deniro03/...') #2 {main} thrown in /home/deniro03/public_html/clients/test4/assets/libraries/Zend/Search/Lucene.php on line 566
            
              • 5811
              • 1,717 Posts
              Again, you are right. As I generated my docindex repositry under Win7 I didn't see this issue.
              So yes the line 46:
              require_once 'Zend/search/lucene.php';

              should be replaced by:
              require_once 'Zend/Search/Lucene.php';


              I will update the indexation.php script in consequence. [EDIT: Done]

              Thanks for this feedback. [ed. note: coroico last edited this post 12 years, 8 months ago.]
                • 7045
                • 225 Posts
                The script does go into the root folder, correct?
                  • 7045
                  • 225 Posts
                  I will assume the following from "Line 64" needs to be changed as well:

                  $url = 'http://localhost/modxrevo/' . $modx->makeUrl($docId); [ed. note: deniro0311 last edited this post 12 years, 8 months ago.]
                    • 7045
                    • 225 Posts
                    Coroico,

                    I am lost and need help. I have made the changes that need to be made to the indexation script, placed it in my root, and ran it. However, I get nothing in my docindex folder, and I get the following error when I run the script:

                    Indexation strating ...
                    Fatal error: Uncaught exception 'Zend_Search_Lucene_Exception' with message 'Index doesn't exists in the specified directory.' in /home/deniro03/public_html/clients/test4/assets/libraries/Zend/Search/Lucene.php:566 Stack trace: #0 /home/deniro03/public_html/clients/test4/assets/libraries/Zend/Search/Lucene.php(225): Zend_Search_Lucene->__construct('/home/deniro03/...', false) #1 /home/deniro03/public_html/clients/test4/indexation.php(175): Zend_Search_Lucene::open('/home/deniro03/...') #2 {main} thrown in /home/deniro03/public_html/clients/test4/assets/libraries/Zend/Search/Lucene.php on line 566

                    I am obviously missing something here or just don't understand this process.
                      • 5811
                      • 1,717 Posts
                      Not easy to understand the reason of this error message. May be your index hasn't be correctly set previously.

                      So do as follow:
                      - remove the folder files/docindex
                      - re run the indexation script

                      By doing this you re-create the docindex, rather to modify the index content