Global Search on Moodle 3.1

Global Search on Moodle 3.1

by Davi DePaula -
Number of replies: 15

I have followed the instructions to install Solr from here https://docs.moodle.org/31/en/Global_search but I'm still having issues installing Solr. I have no errors after installing but the Solr server does not run and I can't figure out how to start it. How should I check if Solr is installed properly and running?


Thank you for your help.


Ubuntu 14.04

Moodle 3.1

PHP 5.5

MySQL 5.5

Average of ratings: -
In reply to Davi DePaula

Re: Global Search on Moodle 3.1

by Davi DePaula -

I am able to access the solr server via localhost:8983/solr but I think I may be missing a a few things. 


I'm getting the following error under the Global search Moodle UI -> "Problem accessing /solr/moodle/admin/system/. Reason: Not Found"

I don't have a directory name /solr/moodle/admin/system/ . What needs to be in this directory? 


Thanks. 

In reply to Davi DePaula

Re: Global Search on Moodle 3.1

by Davi DePaula -

I recreated another solr core and now I'm getting the following error. 

"The specified Solr server is not available or the specified index does not exist"

I have set the index as moodle in the Global Search UI and I create a Solr core named moodle. 

I think the problem I have is that I'm not linking Moodle with Solr so Moodle doesn't know where Solr is. 

What am I missing? 


Here is a picture of my Solr core settings. 


In reply to Davi DePaula

Re: Global Search on Moodle 3.1

by David Monllaó -

Hi David,

If solr server is in the same server than the web server and you set serverhost to localhost, the port to 8983 (default value, I never remember it) and the indexname to 'moodle' (your core name) it should be fine. Access the search admin screen and you should see a link to set up the fields required by moodle into the index (core in your case) that you created.


Ensure that you can access the 'moodle' core through the solr admin interface to confirm that it is ready.

In reply to David Monllaó

Re: Global Search on Moodle 3.1

by Davi DePaula -

Thank you for the help David. 

Yes, my Solr server is running on the same server as Moodle. I can access the Solr server by using www.MyURL:8983/Solr from my web browser and I have created a Solr core named "moodle" but I'm still having no luck in connecting Moodle to Solr. 

Another detail about my Moodle environment. All of my Moodle site runs under HTTPS so all of my URLS are https://MyMoodle.com. Do you think that has anything to do with it?

Again, thank you for your help. 


Davi 

In reply to Davi DePaula

Re: Global Search on Moodle 3.1

by David Monllaó -

Hi,

Does it work or are you redirected to www.MyURL:8983/Solr if you access www.MyURL:8983/solr (solr in lowercase)? In Moodle we hardcode '/solr/' as part of the path to the index so the path is HOST:PORT/solr/INDEXNAME, there is an issue to change it (https://tracker.moodle.org/browse/MDL-54903) You can check if you are affected by this issue by updating search/engine/solr/classes/engine.php's get_search_client and get_connection_url replacing '/solr/' by '/Solr/'

Regarding the https, Moodle's https mode shouldn't interfere with http/https connection to solr, you can see get_connection_url code (same function than above). You should set your server_host to localhost or 127.0.0.1 if you only have 1 web server and solr server in the same OS. Although note that if you serve solr through https you need to check "Secure mode" checkbox.

In reply to David Monllaó

Re: Global Search on Moodle 3.1

by Davi DePaula -

Here is what I checked. 

I can access the Solr server under www.MyURL:8983/solr  (solr in lowercase). 

I'm running apache2 and solr server on the same computer and my /etc/hosts file has the 127.0.0.1 localhost entry in it.

There must be something else configured in my server preventing localhost from working because when I changed the settings in the Global Search moodle's UI from localhost to "www.MyURL.com", and it worked.

I'm running an indexing test right now and I'll publish any issues I run into here. 

Thank you again for your help David. 


Davi. 

In reply to Davi DePaula

Re: Global Search on Moodle 3.1

by David Monllaó -

Hi Davi,

Nice, although note that, if your solr server is publicly accessible through www.MyURL.com:8983, you need to secure the access to it so only moodle accesses its contents. Otherwise you will be exposing all your sites contents.

In reply to David Monllaó

Re: Global Search on Moodle 3.1

by Davi DePaula -

That was the last step I was trying to figure out. I did some searching online and now solr is no longer accessible publicly.


Thank you again for your help David. 

In reply to Davi DePaula

Re: Global Search on Moodle 3.1

by Maarja Tamme -

Hi!

I have different directory for moodle: http://localhost:8983/solr/#/moodle . How can I change this, if I understand correctly, moodle searches it from: http://localhost:8983/solr/moodle ?
Moodle gives me an error message: "The specified Solr server is not available or the specified index does not exist"



In reply to Maarja Tamme

Re: Global Search on Moodle 3.1

by David Monllaó -

Hi Maarja,

Even if the URL you use to access your web admin is http://localhost:8983/solr/#/moodle your site should be configured with localhost as hostname, 8983 as port and moodle as indexname.

If your path is different than '/solr' then you will face https://tracker.moodle.org/browse/MDL-54903, but this does not look like the case.

In reply to Davi DePaula

Re: Global Search on Moodle 3.1

by Jari Vilkman -

Hello,


When you use advanced search you can choose search area f.ex. Book chapters or Book activity information my question is what does "activity information" mean? Where does it search? Is it same as activity description?

In reply to Jari Vilkman

Re: Global Search on Moodle 3.1

by David Monllaó -
Hi Urpo,


Activity information is the activity name, the activity description... Not any contents like book chapters.

In reply to David Monllaó

Re: Global Search on Moodle 3.1

by Jari Vilkman -

Hello,


So it searches from;

  • Activity names
  • Activity description


And nowhere else?

In reply to Jari Vilkman

Re: Global Search on Moodle 3.1

by David Monllaó -

Hi,

It always depends on the search area, but most of the time search areas like xxxx activity description just look at name and description, basically the info that is part of the activity settings page. Plugins implement separate search areas for things like book chapters, database and glossary entries...

In reply to Davi DePaula

Re: Global Search on Moodle 3.1

by Sebastjanas Vaisovas -
What about connecting to Solr Server with SSL certificate? It's unclear in docs which certificate should be set up in Moodle Solr Setup. I have Solr Server with SSL running.