Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check on compatibility with Solr 5 #123

Open
erochest opened this issue Aug 5, 2015 · 20 comments
Open

Check on compatibility with Solr 5 #123

erochest opened this issue Aug 5, 2015 · 20 comments

Comments

@erochest
Copy link
Contributor

erochest commented Aug 5, 2015

No description provided.

@erochest erochest modified the milestone: 2.3.0 Aug 5, 2015
@erochest
Copy link
Contributor Author

No.

Well, indexing works. Search doesn't.

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

@mikesname
Copy link

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

  • change requesthandler class="solr.JsonUpdateRequestHandler" to class="UpdateRequestHandler" (there's a single unified request handler in Solr 6)
  • remove the CSVRequestHandler definition
  • remove the AdminHandler definition (it's included implicitly)

schema.xml

  • change fieldtype definitions solr.(Int|Long|Float|Double|Date)Field to solr.Trie(Int|Long|Float|Double|Date)Field
  • remove all enablePositionIncrements="(true|false)" attributes from filters
  • remove units="degrees" from location_rpt fieldType definition
  • since the ThaiWordFilterFactory seems to have gone, I remove the text_th fieldType definition (perhaps including some of the extra lucene analysis libs would have fixed this instead.)

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

@benjaminh
Copy link

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

@MNicolou
Copy link

MNicolou commented Nov 17, 2016

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

@guitarscape
Copy link

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
Copy link

  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
Copy link

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
Copy link

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

  • you should not need to manually add the omeka core through solr admin dashboard
  • when and why do you need to access http://solrserver:8983/solr/omeka ?
  • I don't think you need to add instanceDir and dataDir manually (and dataDir should be solr-6.3.0/server/solr/omeka/data/). These parameters should be visible on the admin dashboard. In my case, it shows full path to directories btw…

@guitarscape
Copy link

guitarscape commented Dec 9, 2016

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
Copy link

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
Copy link

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

@benjaminh
Copy link

benjaminh commented Dec 13, 2016

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

@guitarscape
Copy link

guitarscape commented Dec 13, 2016

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!

fitnycdigitalinitiatives added a commit to fitnycdigitalinitiatives/SPARCSolrSearch that referenced this issue Feb 22, 2017
@pprw
Copy link

pprw commented Mar 2, 2017

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
Copy link

@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
Copy link

@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
Copy link

ghost commented Oct 13, 2017

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
Copy link

@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
Copy link

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants