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

SOLR-17066: Deprecate SolrJ "core URLs" in ref-guide (9x) #2409

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions solr/solr-ref-guide/modules/deployment-guide/pages/solrj.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,13 @@ Most `SolrClient` implementations (except for `CloudSolrClient` and `Http2SolrCl
The path users include on the base URL they provide has an effect on the behavior of the created client from that point on.

. A URL with a path pointing to a specific core or collection (e.g., `\http://hostname:8983/solr/core1`).
When a core or collection is specified in the base URL, subsequent requests made with that client are not required to re-specify the affected collection.
However, the client is limited to sending requests to that core/collection, and can not send requests to any others.
. A URL pointing to the root Solr path (e.g., `\http://hostname:8983/solr`).
When no core or collection is specified in the base URL, requests can be made to any core/collection, but the affected core/collection must be specified on all requests.

Generally speaking, if your `SolrClient` will only be used on a single core/collection, including that entity in the path is the most convenient.
Where more flexibility is required, the collection/core should be excluded.
When a core or collection is specified in the base URL, subsequent requests made with that client are not required to re-specify the affected collection on each request.
However, clients that use this form of URL can only be used to send requests to the core or collection included in the URL.
"Admin" (i.e. non-core) requests, or requests made to other indices using the client will fail.
Because of these limitations, usage of this type of path is deprecated and will be removed in Solr 10.
Users are encouraged to instead provide a "root" base URL when creating their client (see below), and specify the core using the `withDefaultCollection(String)` method available on the relevant `SolrClient` Builder object.
. A URL pointing to the root Solr path (e.g. `http://hostname:8983/solr`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need the leading "."?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, the leading '.' on L127 is used to identify the start of a new item in the list. See L121 above for another example.

I've intentionally omitted the '.' on lines 124-126 because I want each of those sentences to be included in the preceding list item.

Users who wish to specify a default collection may do so using the `withDefaultCOllection(String)` method available on the relevant `SolrClient` Builder object.

==== Base URLs of Http2SolrClient
The `Http2SolrClient` manages connections to different nodes efficiently.
Expand All @@ -136,7 +136,7 @@ If not an `IllegalArgumentException` will be thrown.

==== Base URLs of CloudSolrClient

It is also possible to specify base URLs for `CloudSolrClient`, but URLs are expected to point to the root Solr path (e.g., `\http://hostname:8983/solr`).
It is also possible to specify base URLs for `CloudSolrClient`, but URLs must point to the root Solr path (e.g., `\http://hostname:8983/solr`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need the leading slash?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we do, the leading slash ensures that asciidoc renders the URL as unclick-able. (i.e. we want the URL to be formatted as code, not an actual link that a user would get value in clicking). See some of the other URLs in this page as examples...

They should not include any collections, cores, or other path components.

[source,java,indent=0]
Expand Down