We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51020
    • 670 Posts
    Hi,

    It has been recommended that I use 'Solr' to enhance and accelerate my search.
    I have checked with the hosting co, and I have Solr installed on my Apache server - but I can't find any documentation on how to install Solr into Modx.
    I have this:
    https://rtfm.modx.com/extras/revo/simplesearch/simplesearch.solr

    It says:
    You have installed the PECL Solr package, which can be found here http://pecl.php.net/package/solr.


    But I can't work out what to do next! I downloaded the latest release, and tried to upload it to Modx, but it says it's not a valid package.

    Can anyone point me in the right direction?

    Thanks for any help you can give

    Andy

      • 51481
      • 45 Posts
      Hi Andy,

      I'm working towards a similar goal: Getting SimpleSearch to use Solr (my goal is to be able to search through the contents of PDF files). You can see my thread here: https://forums.modx.com/thread/100363/parse-pdf-content-for-search-results#dis-post-542433

      Unfortunately, I can't help you... But I'm hoping we can band together and figure this out together (with help from others, hopefully).

      Honestly, I couldn't figure out the PECL step too so I just skipped it. I got my PDFs added to the Solr core, but I can't get the SimpleSearchIndexAll to function. Could be that I'm needing the PECL step?

      Hopefully someone can help us! [ed. note: matthewmeredith last edited this post 10 years, 4 months ago.]
        • 51020
        • 670 Posts
        Quote from: matthewmeredith at Jun 13, 2016, 02:50 PM
        Hi Andy,

        I'm working towards a similar goal: Getting SimpleSearch to use Solr (my goal is to be able to search through the contents of PDF files). You can see my thread here: https://forums.modx.com/thread/100344/parse-pdf-content-for-search-results#dis-post-542410

        Unfortunately, I can't help you... But I'm hoping we can band together and figure this out together (with help from others, hopefully).

        Honestly, I couldn't figure out the PECL step too so I just skipped it. I got my PDFs added to the Solr core, but I can't get the SimpleSearchIndexAll to function. Could be that I'm needing the PECL step?

        Hopefully someone can help us!

        Ok thanks - sounds like you are further than I am!! I don't even know how to install the search in the first place!
          • 51481
          • 45 Posts
          Quote from: tm2000 at Jun 14, 2016, 02:57 AM
          Ok thanks - sounds like you are further than I am!! I don't even know how to install the search in the first place!

          Just out of curiosity, have you tried:
          [root@vps /]# pecl list

          to see if you have pecl already on your server? If your host already has Solr installed, it might have the PECL package set up already as well.
            • 51020
            • 670 Posts
            Quote from: matthewmeredith at Jun 14, 2016, 04:13 PM
            Quote from: tm2000 at Jun 14, 2016, 02:57 AM
            Ok thanks - sounds like you are further than I am!! I don't even know how to install the search in the first place!

            Just out of curiosity, have you tried:
            [root@vps /]# pecl list

            to see if you have pecl already on your server? If your host already has Solr installed, it might have the PECL package set up already as well.

            Thanks - my host says pecl is already installed.
            I don't understand your code though - where do I put that to see if the package is installed?

            Thanks
            Andy
              • 51020
              • 670 Posts
              Correction. They said Solr is already installed.
              Not sure what pecl is?

                • 51481
                • 45 Posts
                Quote from: tm2000 at Jun 14, 2016, 04:55 PM
                Correction. They said Solr is already installed.
                Not sure what pecl is?


                PECL is just a repository for PHP Extensions. https://pecl.php.net/

                Solr is just one of the search engine extensions that are available through PECL.

                The command in my last post is done in SSH (Secure Shell), also known as the command prompt or terminal. Do you have SSH access to your server? It should look exactly like a Linux terminal except it connects to your server as opposed to your local computer. As root, run the command:
                pecl list

                Which will generate a list of all the PHP extensions that were installed by PECL.

                Hope that helps!
                  • 51020
                  • 670 Posts
                  Quote from: matthewmeredith at Jun 14, 2016, 06:39 PM
                  Quote from: tm2000 at Jun 14, 2016, 04:55 PM
                  Correction. They said Solr is already installed.
                  Not sure what pecl is?


                  PECL is just a repository for PHP Extensions. https://pecl.php.net/

                  Solr is just one of the search engine extensions that are available through PECL.

                  The command in my last post is done in SSH (Secure Shell), also known as the command prompt or terminal. Do you have SSH access to your server? It should look exactly like a Linux terminal except it connects to your server as opposed to your local computer. As root, run the command:
                  pecl list

                  Which will generate a list of all the PHP extensions that were installed by PECL.

                  Hope that helps!

                  Ah ok. I don currently have ssh access. But the hosting company have said Solr is installed.
                  I just don't know what the next step is to utilise it with my search.
                    • 51020
                    • 670 Posts
                    The documentation says this:

                    You have a running Solr server with an index that can be used for the MODX installation.

                    But I cant work out how to go about this.
                      • 51481
                      • 45 Posts
                      Quote from: tm2000 at Jun 15, 2016, 12:58 AM
                      The documentation says this:

                      You have a running Solr server with an index that can be used for the MODX installation.

                      But I cant work out how to go about this.

                      Well Solr is installed, but you have to create a core and then add whatever you want to be indexed to it. However, I don't now of a way to do this without SSH. To create your core, run:
                      su - solr -c "/opt/solr/bin/solr create_core cmx"

                      but replace "cmx" with whatever you want your core to be named. Make sure to open up your Solr Admin panel at http://127.0.0.1:8983/solr/ (or whatever the IP address of your server is).

                      After that it's just a matter of changing your System Settings in the sisea section. Then add your Resources to the Solr index by using the SimpleSearchIndexAll snippet on a page (you should get a confirmation text of "Successfully indexed 13 resources" or however many you have).