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

Multiple collections do not work properly #52

Open
maxpatiiuk opened this issue Mar 27, 2020 · 9 comments
Open

Multiple collections do not work properly #52

maxpatiiuk opened this issue Mar 27, 2020 · 9 comments

Comments

@maxpatiiuk
Copy link
Member

I am pretty sure that WP works well and I just made some mistake when setting up my WP

In order to find the possible issue, here is some information that may help:

My settings.json
image

Webportal displays all records from collection1 and collection2
Screen Shot 2020-03-27 at 11 41 32 AM
Could the problem be connected with the fact that that column has spaces in its values?

But the Collection button is not present
https://files.slack.com/files-pri/TC55W6XA8-F010V5N2588/screen_shot_2020-03-26_at_12.11.35_pm.png

I did restart solr and nginx

Also, I should say that I had exports from two collections in specify_exports folder
Screen Shot 2020-03-27 at 11 43 34 AM

And running make clean && make caused two collections to become visible on the WP menu page
Screen Shot 2020-03-27 at 11 43 59 AM

But m2 does not have any records
Screen Shot 2020-03-27 at 11 44 11 AM

And importing them causes an error
Screen Shot 2020-03-27 at 11 44 24 AM

@maxpatiiuk maxpatiiuk added the bug label Mar 27, 2020
@timo11
Copy link
Contributor

timo11 commented Mar 27, 2020

The Collection button appears for me with "collections":[{},{}]. It doesn't work, but it appears whenever the collections setting contains more than one item. I have no idea why it isn't appearing.

When aggregating collections, only one .zip file should be in specify_exports. Only the PortalData.csv file is needed for the other collections.

@timo11
Copy link
Contributor

timo11 commented Mar 30, 2020

The portal (web app and solr server) only needs to be built for one collection. Two collections are irrevelant. Maybe you only created one solr instance, but copied the web app data for both collections to the http servers root directory? Also I'm pretty sure the collections definition is in the wrong settings file.

@maxpatiiuk
Copy link
Member Author

It works!
Kind of
The thing I did wrong was changing thesettings.json file after running make clean && make

The new problem is that I get no results after search if any one of the collections is selected
Works fine if I select all or none


Screen Shot 2020-03-30 at 4 58 04 PM
Screen Shot 2020-03-30 at 4 58 10 PM

Screen Shot 2020-03-30 at 4 57 30 PM
Screen Shot 2020-03-30 at 4 57 37 PM

Screen Shot 2020-03-30 at 4 57 43 PM
Screen Shot 2020-03-30 at 4 57 48 PM

Screen Shot 2020-03-30 at 4 57 56 PM
Screen Shot 2020-03-30 at 4 57 48 PM

@maxpatiiuk
Copy link
Member Author

maxpatiiuk commented Mar 31, 2020

@timo11 here are the steps I used to install WP with multiple collections:

  1. Placed m1.zip into specify_exports
    m1.zip
  2. git_pull
  3. Replaced resources/config/settings.json with my modified file
    settings.json.zip (unzip it)
  4. Run the following commands:
make clean && make

mkdir solr-7.5.0/server/solr/m1
cp -r build/cores/m1/core/* solr-7.5.0/server/solr/m1
cp build/cores/m1/web.xml solr-7.5.0/server/solr-webapp/webapp/WEB-INF/web.xml # Only necessary for the first core.
solr-7.5.0/bin/solr start
curl 'http://localhost:8983/solr/m1/update/csv?commit=true&encapsulator="&escape=\&header=true' --data-binary @build/cores/m1/PortalFiles/PortalData.csv -H 'Content-type:application/csv'
  1. Place the following into /etc/nginx/sites-available/default (and replace default location / instruction)
    rewrite ^/([^/]+)/select /solr/$1/select;

    location /solr/ {
             proxy_pass http://localhost:8983/solr/;
     }

    location / {
             root /home/specify/Downloads/webportal-installer/build/html;
     }
  1. Run the following commans:
sudo systemctl restart nginx

curl 'http://localhost:8983/solr/m1/update/csv?commit=true&encapsulator="&escape=\&header=true' --data-binary @specify_exports/PortalFiles/PortalData.csv -H 'Content-type:application/csv'

solr-7.5.0/bin/solr restart

Here is the PortalData.csv from the second collection:
m2.zip

I can send a video recording of me reproducing all of these steps

@timo11
Copy link
Contributor

timo11 commented Mar 31, 2020

The codes are 'KUITeach' and 'KUIT'. Also, case might not matter, but the collCodeSolrFld is "code" with a little "c". I still don't understand why settings in files in /home/specify/Downloads/webportal-installer/build/html/tissuedwc/resources/config/ wouldn't be reflected in the portal.

@maxpatiiuk
Copy link
Member Author

You were right, I was supposed to have collectionName as collCodeSolrFld
After changing that and reloading solr, WP did not change in any way
Also, completely commenting out the section regarding multiple collections and restarting solr did not lead to any changes in WP

Screen Shot 2020-04-03 at 2 34 32 PM

I will try to rebuild WP from scratch and report my progress

@timo11
Copy link
Contributor

timo11 commented Apr 3, 2020

restarting solr doesn't have anything to do with changing the portal app config.
You change /home/specify/Downloads/webportal-installer/build/html/tissuedwc/resources/config/ settings.json and nothing changes in the portal? Maybe you need to restart nginx. Or do a hard reload in the web browser.

@maxpatiiuk
Copy link
Member Author

Reinstalled WP on a clean VM
Used the same procedure and the following settings.json file (same one with collectionName as collCodeSolrFld) :
settings.json.zip

Searching works like expected and data is present in both collections

@maxpatiiuk
Copy link
Member Author

Okay, I found out the solution problem with the settings file
I was modifying the settings file in PortalApp/resources/config/
Modifying the file in build/html/m1/resources/config/ resulted in changes be reflected immediately

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

2 participants