GithubHelp home page GithubHelp logo

Comments (10)

makuk66 avatar makuk66 commented on May 19, 2024 2

With the latest version of docker-solr you can now do something like:

docker run -P -i -v $PWD/apachesolr/solr-conf/solr-4.x:/myconfig solr solr-create -c drupalcore -d /myconfig

Alas that solr-4 config is not compatible with Solr 6, so you get error messages and no core. Fixing that config looks to be tracked upstream https://www.drupal.org/node/2453855 and https://www.drupal.org/node/2442077.
I tried the proposed https://www.drupal.org/project/1600962/git-instructions with:

docker run -P -d -v $PWD/other/apache_solr_common_configurations/conf/5.x/:/myconfig solr:5.3 solr-create -c mycore -d /myconfig

and that loaded. But I've not tried actually using it from Drupal container.

In any case, I don't think there's anything here to be done in docker-solr, so I'll close this bug.

from docker-solr.

makuk66 avatar makuk66 commented on May 19, 2024 2

Perhaps:

version: '2'
services:

  solr:
    image: docker-solr/docker-solr:5.3
    ports:
     - "8983:8983"
    volumes:
      - ./other/apache_solr_common_configurations/conf/5.x/:/myconfig
    entrypoint:
      - docker-entrypoint.sh
      - solr-create
      - -c
      - mycore
      - -d
      - /myconfig

from docker-solr.

mparker17 avatar mparker17 commented on May 19, 2024

@mccrodp I agree that an officially-supported Docker image with the Apache Solr Search module's structure, and also an officially-supported Docker image with the Search API Solr module's structure would be nice... as an unofficial maintainer for these Docker images, it would certainly save me some time, since I don't use these modules on every project, so I don't always update my images as fast as the upstream modules change.

However, this issue is filed in the queue for the Apache Solr software project itself (a generic search backend written in Java and used by many other pieces of software, two of which are Drupal's Apache Solr Search module, and Drupal's Search API Solr module)... I think the maintainers of those Drupal modules should be the ones providing the official support, not the maintainers of Apache Solr itself.

So you'd probably get better results by filing this feature request in those modules' issue queues instead:


Background...

Solr is a generic database backend, similar to how MySQL is a generic database backend, and, like MySQL, Solr needs to have a structure created on it before Drupal can use it. Unlike MySQL, however, setting up Solr's structure is a bit more complicated, because you have to save files in a special directory on the filesystem and restart the server (as opposed to MySQL where you can set up a structure by running CREATE TABLE statements and the new structure is available immediately). This means that the Apache Solr Search and Search API Solr modules cannot install / keep their own structures up-to-date the way that Drupal can with MySQL.

To make things more complicated, the Drupal ecosystem has a few different modules, mainly Apache Solr Search, and Search API Solr, each of which can allow Drupal to use Solr as it's search backend.

But the Solr structure that the Apache Solr Search module needs is incompatible with the Solr structure that the Search API Solr module needs, similar to the way that Backdrop and Drupal 8's MySQL database structures are incompatible.

Likewise, the data structure used by these modules changes with each version of the module, similar to how Drupal 7's database structure differs from Drupal 8's database structure.

from docker-solr.

mccrodp avatar mccrodp commented on May 19, 2024

Really appreciate this detailed response @mparker17, that really clarifies things from many angles.

Yes, it makes complete sense that the Apache Solr Drupal module maintainers are the ones pushing forward with integrations, but I guess if they had time they would be doing this also. I guess it's a similar case to the jQuery version being used in Drupal core, always a few steps behind to ensure compatibility. It is just unfortunate in this case that it blocks using the latest version and even this supported (generic) repo.

Drupal is gaining corporate momentum (which I guess is good and bad), so perhaps a company will come along and start being the official maintainers for something like this and they'll get to put their logo beside it 😉

Thanks for your work and help!

from docker-solr.

makuk66 avatar makuk66 commented on May 19, 2024

@mparker17 said:

I think the maintainers of those Drupal modules should be the ones providing the official support

I agree. The docker-solr image is just a generic Solr distribution for Docker, with as little deviation from the upstream Apache Solr project as possible. We won't be adding consumer-specific extra configuration.

Consumers of Solr should where possible use the Solr APIs and commands to create their desired configuration, rather than rely on config and custom images, so they can treat Solr as a black box that is then easier to upgrade.

I see in Drupal Apache Solr Search module documentation that is uses config files; you might find this comment useful as an example of how to modify configuration.

Another option may be to create a shell script that makes the required modification and then invokes Solr -- then make that script available to the container with a volume, and execute it instead of the default solr command. That way you can docker run an unmodified docker-solr image that is configured for your use, and you won't need to use cp or exec. You should be able to do that with docker compose.

from docker-solr.

mccrodp avatar mccrodp commented on May 19, 2024

@makuk66 Thanks for this. While it is certainly helpful as a reference for myself for future it will also help others with more knowledge than me. My knowlege of Solr is somewhat limited, but growing, gradually.

I wonder is there potential for Drupal to interface directly with the Schema API then, perhaps in a Solr Schema API Drupal module, allowing for config through PHP or even a UI using a REST service or something to update the schema on the server Solr resides on. This may not be practical, but if it were, it could help the less Solr-savvy Drupal devs. I guess you'd have to be able to issue a restart of the Solr server from this UI then also, if so maybe it's not ideal in some ways.

from docker-solr.

gagarine avatar gagarine commented on May 19, 2024

@makuk66 how can you achieve that in a docker-compose file?

from docker-solr.

gagarine avatar gagarine commented on May 19, 2024

@makuk66 Thanks a lot. I think I'm still don't fully understand entrypoint, I will check this out.

from docker-solr.

mparker17 avatar mparker17 commented on May 19, 2024

@gagarine the differences between ENTRYPOINT and CMD are subtle (check out the documentation for the full picture).

Essentially, if you recall the syntax for the docker run command...

docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]

... using ENTRYPOINT lets you set the [COMMAND] part, meaning the syntax when running a image with an ENTRYPOINT becomes...

docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [ARG...]

... if you want to override the ENTRYPOINT, you have to pass the option --entrypoint=/path/to/new-cmd to docker run.


You might find it helpful to think of Dockerfiles without ENTRYPOINT lines as having a default ENTRYPOINT of /bin/sh -c. To use a simple example, docker run ubuntu:latest echo test is kind-of like running docker run ubuntu:latest /bin/sh -c 'echo test' (ubuntu:latest only has a CMD, not an ENTRYPOINT)

from docker-solr.

gagarine avatar gagarine commented on May 19, 2024

@mparker17 I think I got it, I will adapt my configurations accordingly. Thanks for your help.

from docker-solr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.