Conversation
It looks like there aren't many good options for parsing arguments in rake. This produces the cleanest command line invocation: rake solr:create <directory> <name>
|
If preferred, I can change the task to use rake's native argument handling. i.e. invocation with: prompt$ rake solr:create[directory, name] |
|
I would like to see this called |
| task(name.to_sym) {} | ||
| @solr_instance.create dir: directory, name: name | ||
| else | ||
| raise "Usage: rake solr:create <directory> <name>" |
There was a problem hiding this comment.
This shouldn't be an exception, it should just log to $stderr
|
I don't understand why you'd want to do all this argument handling in rake when you have a binary script that is a lot more flexible at it. |
|
I wonder if we need to expose the path to the unpacked |
|
To explain my motivation, I was following along the Dive into Hydra guide, but every time I stopped and restarted solr, it would lose the data in the collection. I also noticed that Using |
Invocation now looks like: rake solr:collection:create <directory> <name> Failing to specify a directory or name no longer raises an exception.
@cbeer do you know how to make collections persistent in Solr 5/6? |
|
By design, it does not persist instance data. It might be possible to add configuration to disable that behavior, but we'd want to think hard about whether that's a good idea. In most cases where we're interested in persistence, I think we ought to encourage people to run solr directly. Another alternative, if we want to support changing the solr collection configuration, is presented in #17. |
|
@cbeer, @jcoyne: I know I did something very similar so I could could just run rake solr:start in development and not need to worry about losing the state of my solr instance all the time. This PR comes close to allowing the user to run rake solr:start (like we used to run rake jetty:start) and you are up for development. I was just about to put in a very similar PR when i realized this one already existed: https://github.com/cbeer/solr_wrapper/compare/master...psu-stewardship:solr_config?expand=1 |
|
@bertrama The new preference would be to use the executable. @cbeer included a new flag -preserve that keeps data from one run to the next. Can we close this PR? In addition we changed the Active Fedora Generator to add this flag by default when the test app is generated in sufia. There is some documentation on running with the new configuration files here: https://github.com/projecthydra/sufia/wiki/Sufia-Development-Guide#work-with-test-app-in-the-browser |
|
Yeah, that'll work for me, thanks! |
It looks like there aren't many good options for parsing arguments in rake.
This produces the cleanest command line invocation: