scholarslab / SolrSearch

Add a Solr-backed search interface to Omeka.
http://omeka.org/codex/Plugins/SolrSearch
Apache License 2.0
22 stars 28 forks source link

Check on compatibility with Solr 5 #123

Open erochest opened 9 years ago

erochest commented 9 years ago

No.

Well, indexing works. Search doesn't.

I'm pushing this off for the next release, though.

mikesname commented 7 years ago

Not sure if this 18 month old issue is still relevant, but here are the changes I had to make to the solr_core config to get it to work (indexing and search) with Solr 6.2:

solrconfig.xml

schema.xml

I think that probably the schema changes would be compatible with Solr 4. Not sure about the config ones.

benjaminh commented 7 years ago

Thanks for sharing this. I can confirm above changes also work with Solr 6.3

MNicolou commented 7 years ago

Excellent advice @mikesname. Just got it working with Solr 6.3.0 too @benjaminh.

guitarscape commented 7 years ago

Hi benjaminh and MNicolou,

I am still having trouble making this to work. Could you please share some details of your setup? Particularly

  1. Did you set up Solr 6.3 standalone or with Tomcat?
  2. After you set up Solr, how did you add omeka core to the Solr engine?
  3. When it comes to configuring SolrSearch plugin, exactly what strings did you use for 1) ServerHost 2) ServerPort and 3) CoreURL?

Thanks in advance for your help.

benjaminh commented 7 years ago
  1. You can follow http://lucene.apache.org/solr/quickstart.html for quickstart instructions. I did set up Solr as a standalone server (not sure if a solr installation under tomcat is supported as of solr 6.3 version)

  2. You need to copy the omeka core folder into solr-6.3.0/server/solr

  3. In my case, I'm still working on a localhost instance. So :

    • ServerHost = localhost
    • ServerPort = 8983 (default)
    • Core URL = /solr/omeka/
guitarscape commented 7 years ago

Thanks benjaminh!

I installed the standalone server and passed all the test in quickstart. i copied omeka core folder (SolrSearch/solr-core/omeka) to solr-6.3.0/server/solr/ restarted solr service when I opened http://solrserver:8983 I can see the admin dashboard. Do i have to add the omeka core through admin dashboard? Anyway, i modified the solrconfig.xml and schema.xml files to add the omeka core: name: omeka insancedir: solr-6.3.0/server/solr/omeka dataDir: data

core was added. but http://solrserver:8983/solr/omeka shows 404 error http://solrserver:8983/solr/#/~cores/omeka shows the core info, though.

In omeka SolrSearch plugin config page: Server Host: solrserver Server Port: 8983 Core URL: /solr/omeka says Solr connection is invalid.

any ideas?

Thanks again!

benjaminh commented 7 years ago

I'm not expert in solr, so I can only compare with my config.

guitarscape commented 7 years ago

benjaminh, thanks for your continued assistance. here is a rundown of what I did to try to make things work. say i have 2 servers, webserver and solrserver. webserver runs the omeka system and solrserver runs solr. i already have omeka running on webserver.

on solr server:

cd /root wget http://apache.claz.org/lucene/solr/6.3.0/solr-6.3.0.tgz tar zxvf ./solr-6.3.0.tgz cd solr-6.3.0/bin ./install_solr_service.sh /root/solr-6.3.0.tgz -d /var/log/solr -i /usr/local/ -p 8983 -s solr -u solr

the above script comes with the solr package and simply installs solr in /usr/local/, create a solr user, and a service startup script in /etc/init.d/

the script will tell you that the solr is installed and successfully started on port 8983. this can be verified by opening http://solrserver:8983 in web browser. Note that the http://solrserver:8983 will say "no cores available" (that was why I thought i needed to manually add the omeka core to the solr server)

below is the output of the script:

Creating new user: solr Extracting /root/solr-6.3.0.tgz to /usr/local/ Installing symlink /usr/local//solr -> /usr/local//solr-6.3.0 ... Installing /etc/init.d/solr script ... Installing /etc/default/solr.in.sh ... Service solr installed. Customize Solr startup configuration in /etc/default/solr.in.sh Waiting up to 180 seconds to see Solr running on port 8983 []
Started Solr server on port 8983 (pid=22320). Happy searching! Found 1 Solr nodes: Solr process 22320 running on port 8983 { "solr_home":"/var/log/solr/data", "version":"6.3.0 a66a44513ee8191e25b477372094bfa846450316 - shalin - 2016-11-02 19:52:42", "startTime":"2016-12-09T16:02:16.915Z", "uptime":"0 days, 0 hours, 0 minutes, 10 seconds", "memory":"12.7 MB (%2.6) of 490.7 MB"}

Next, I stoped the solr service:

service stop solr cd /root wget http://omeka.org/wordpress/wp-content/uploads/Solr-Search-2.3.0.zip unzip Solr-Search-2.3.0.zip

copy SolrSearch omeka core to Solr installation:

cp -a SolrSearch/solr-core/omeka /usr/local/solr-6.3.0/server/

make all the necessary changes to /usr/local/solr-6.3.0/server/omeka/conf/schema.xml and /usr/local/solr-6.3.0/server/omeka/conf/solrconfig.xml

create data dir in omeka solr core

mkdir /usr/local/solr-6.3.0/server/omeka/data chmod og+rwX /usr/local/solr-6.3.0/server/omeka/data

restart solr server

service solr start

Then I went to Omeka SolrSearch plug in configuration page on the webserver and put in Server Host: IP of solrserver Server Port: 8983 Core URL: /solr/omeka

and press "save setting" and the page just says: Solr connection is invalid.

Same thing if I install Solr on the same server as Omeka (i.e. on the webserver and use localhost in "Server Host" field.

I am not sure what i am doing wrong so that the handshaking btw omeka and solr does not happen.

Thanks for reading and helping!

benjaminh commented 7 years ago

One thing seems suspicious : when you copy solrsearch omeka core to solr installation, you mentioned cp -a SolrSearch/solr-core/omeka /usr/local/solr-6.3.0/server/. Destination folder should be /usr/local/solr-6.3.0/server/solr

guitarscape commented 7 years ago

that was a typo in the reply. yes it was copied into the solr directory.
how did you start your solr server?

benjaminh commented 7 years ago

Simply with command line : ./bin/solr start in your solr-6.3.0 directory

guitarscape commented 7 years ago

ok. i made a little progress, but still not there yet. The funny thing about solr is that, when solr service is launched under root account, solr is not capable of loading any cores in server/solr/ directory automatically. third party cores can be automatically detected when solr is launched under a regular user account. I think this is a defect of solr. That said, when I launch solr as the user 'solr', the omeka core in solr-6.3.0/server/solr/omeka is automatically detected and loaded (verified via browser http://localhost:8983) however, omeka still complains that 'Solr connection is invalid.' when I used the following configuration: Server Host: localhost port: 8983 URL: /solr/omeka/

I am running out of thoughts!

pprw commented 7 years ago

Hi, I am trying to test Omeka Solr Search addon.

I have followed the apache quick guide. I decompressed solr on /home/user/bin/solr/ and launch it with:

run: bin/solr start -e cloud -noprompt

At this point, I am able to access to the solr administration interface (http://localhost:8983/solr/).

The problem is about the omeka core. I copied solr-core/omeka to /home/user/bin/solr-6.4.1/server/solr and restarted solr but the new core is not recognized. I tried also to put it with /home/user/bin/solr-6.4.1/example/cloud/ without success.

Is there something to do to install the omeka core?

benjaminh commented 7 years ago

@guitarscape I recently had some issues establishing a connection between two virtual machines (one for omeka, and one for solr). I don't know if this can help, but I found out that the "Solr connection is invalid" message is just the result of a http request to the solr instance (see helpers/SolrSearch_Helpers_Index.php and lib/solr-php-client/Service.php files. So maybe you can manually try to access the ping URL http://localhost:8983/solr/omeka/admin/ping and see if you have more info on why it fails to connect

benjaminh commented 7 years ago

@pprw In the dashboard of the solr administration interface, among JVM settings, you should check that -Dsolr.solr.home parameter is correctly set. In your case, it should be : /home/user/bin/solr-6.4.1/server/solr I had the same issue once, I didn't figure out why solr came up with wrong settings (probably a misconfiguration from me), but manually correcting this parameter solved the issue.

ghost commented 6 years ago

I followed @mikesname amendments and the plugin works for me with Solr 7.0.1 too. However, with many warnings in logs. Hopefully this plugin is going to be adjusted for newer Solr?

EDIT: I only noticed a warning at the bottom of the page upon triggering a search: Strict Standards: Declaration of SolrSearchField::beforeSave() should be compatible with Omeka_Record_AbstractRecord::beforeSave($args) in xxx/plugins/SolrSearch/models/SolrSearchField.php on line 169

germanychad commented 6 years ago

@benjaminh I was following @guitarscape's issues with configuring the server and a "Solr Connection Is Invalid Message." I made the solrconfig.xml and schema.xml amendments and have the Omeka core successfully running in Solr 7.0.1. I am getting the same message, but the ping URL isn't displaying any errors. screen shot 2017-10-22 at 7 00 15 pm screen shot 2017-10-22 at 7 00 05 pm

Any suggestions?

Thank you

guitarscape commented 6 years ago

hi germanychad,

two things i would suggest that you test is 1. disable SELinux and/or 2. disable firewall i don't recall clearly but it was some selinux boolean (httpd_can_network, or something like that) I had to turn on to allow traffic between apache and solr/java (between port 80 and port 8983). but don't turn off SElinux or firewall on production system. Only allow necessary traffic.

good luck.

candelariajr commented 6 years ago

I followed @mikesname s solution to modifying the files A few notes though: '--' is not allowed in comments, so when blocking off sections of xml that have comments contained within them, you get an exception. And the line: ~1123 on solrconfig.xml is changed to AdminHandlers (looks like: ) is what has to be deleted.

@piotreba , I ran into the same issue you did. Omeka has been updated since this plugin was last updated. On newer versions the SolrSearchField function takes and utilizes an argument in beforeSave(). This plugin uses the old version that doesn't supply one, so the argument is not needed. You can just add $args to the function declaration at the bottom of SolrSearchFile.php in \plugins\SolrSearch\models\SolrSearchField.php so that it matches the interface.