Stream: community

Topic: connecting to solr


view this post on Zulip jamie jamison (Jul 12 2024 at 18:13):

The UCLA Dataverse is part of the library. The library would like to pull Dataverse objects into an Elasticsearch index for public discovery. Which would involve querying solr. This is what they use for other apps:
curl -I -L "https://dataverse.ucla.edu:8983/solr/collection1/select?q=*:*"

I tried this from localhost:
curl -I -L "https://localhost:8983/solr/collection1/select?q=*:*"

curl: (35) SSL received a record that exceeded the maximum permissible length.

If I try not from a local host I just get a timeout. Is there a way to get this solr information from outside the dataverse server?

view this post on Zulip Philip Durbin ๐Ÿš€ (Jul 12 2024 at 18:22):

Hmm, let's try to get it working from localhost first.

I dev I do something like this:

curl -s 'http://localhost:8983/solr/collection1/select?rows=1000000&wt=json&indent=true&q=*%3A*'

That's not working for you?

This if from https://github.com/IQSS/dataverse/blob/v6.3/scripts/search/query by the way.

view this post on Zulip jamie jamison (Jul 12 2024 at 18:25):

That works perfectly from localhost. But, it needs to be run from the outside. I probably need to research that part.
Thank you!

Philip Durbin said:

Hmm, let's try to get it working from localhost first.

I dev I do something like this:

curl -s 'http://localhost:8983/solr/collection1/select?rows=1000000&wt=json&indent=true&q=*%3A*'

That's not working for you?

This if from https://github.com/IQSS/dataverse/blob/v6.3/scripts/search/query by the way.

view this post on Zulip Philip Durbin ๐Ÿš€ (Jul 12 2024 at 18:30):

We have a section on Solr security, one sec.

view this post on Zulip Philip Durbin ๐Ÿš€ (Jul 12 2024 at 18:30):

https://guides.dataverse.org/en/6.3/installation/prerequisites.html#securing-solr

view this post on Zulip Philip Durbin ๐Ÿš€ (Jul 12 2024 at 18:33):

It looks like there's a SOLR_IP_ALLOWLIST in bin/solr.in.sh (that file is mentioned above).

view this post on Zulip Philip Durbin ๐Ÿš€ (Jul 12 2024 at 18:34):

I've never used it.

view this post on Zulip Philip Durbin ๐Ÿš€ (Jul 12 2024 at 18:34):

The main thing is the make sure you keep blocking the rest of the Internet :grinning:

view this post on Zulip jamie jamison (Jul 12 2024 at 18:35):

:+1:

view this post on Zulip Oliver Bertuch (Jul 12 2024 at 20:36):

It would be even better to protect your Solr with a username/password, but that would also require some code changes in Dataverse to inject these deets into the client. Also: it's probably a good idea to make use of HTTPS in Solr (which is no problemo for Dataverse already, as you can set the protocol bit).

view this post on Zulip Philip Durbin ๐Ÿš€ (Jul 12 2024 at 20:47):

Related: Adding Solr Basic Authentication #9337

view this post on Zulip Oliver Bertuch (Jul 12 2024 at 20:50):

I'm not sure if you can try to inject the basic auth stuff as part of the host definition

view this post on Zulip Oliver Bertuch (Jul 12 2024 at 20:51):

host = "user:pass@host"

view this post on Zulip Oliver Bertuch (Jul 12 2024 at 20:51):

MIght be worth a shot...

view this post on Zulip Oliver Bertuch (Jul 12 2024 at 20:51):

Or readin' some docs


Last updated: Nov 01 2025 at 14:11 UTC