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

Add support for standard collection aliases #46

Merged
merged 3 commits into from
Jul 16, 2018
Merged

Add support for standard collection aliases #46

merged 3 commits into from
Jul 16, 2018

Conversation

magro
Copy link
Member

@magro magro commented Jul 16, 2018

This adds support for standard collection aliases (in contrast to (time) routes aliases, see also the Collections API / CREATEALIAS docs).

While the implementation uses only the first aliased collection to resolve possible replica urls for the query, on server side solr will still query all (multiple) aliased collections and return the combined result.

Closes #31, #39

`solr-home/collection2/conf` is a symlink to `../collection1/conf`
to prevent copying all this stuff in the source tree.

This symlink required some changes:
* copy the solrhome not from the `target/` directory but from the
  source directory (because sbt "copies" the symlink as empty directory)
* no longer use commons-io `FileUtils.copyDirectory` but use our own
  solution, because commons-io does not handle the symlink appropriately
  (and the existing scala better-files does it not better)

The symlink actually is resolved during the copy, i.e. the link
target directory is copied to the destination: necessary because
uploading from the symlink directory failed (in `SolrZkClient.uploadToZK`).

All this stuff is basically a preparation for collection alias tests.
* `SolrServers.matching` now returns `Try` instead of just an empty
  list in case of issues (e.g. an unknown collection)
* `LoadBalancer.solrServer` now returns a `Try` instead of `Option`
This adds support for standard collection aliases (in contrast
to (time) routes aliases, see also the [Collections API / CREATEALIAS docs](https://lucene.apache.org/solr/guide/7_4/collections-api.html#createalias).

While the implementation uses only the first aliased collection to resolve
possible replica urls for the query, on server side solr will still query
all (multiple) aliased collections and return the combined result.

Closes #31, #39
@magro
Copy link
Member Author

magro commented Jul 19, 2018

Released with solrs 2.2.0

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

Successfully merging this pull request may close these issues.

1 participant