Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-16761: Document the bin/solr api command (#1581)

Eric Pughb827f119314c
diff --git a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
index d489d5abee5..b6fa377decf 100644
--- a/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
+++ b/solr/solr-ref-guide/modules/deployment-guide/pages/solr-control-script-reference.adoc
@@ -1377,7 +1377,9 @@ Examples of this command:
`bin/solr zk mkroot /solr/production`
-== Exporting Documents to a File
+== Exporting and Importing
+
+=== Exporting Documents to a File
The `export` command will allow you to export documents from a collection in either JSON or Javabin format.
All documents can be exported, or only those that match a query.
@@ -1466,7 +1468,7 @@ Export all documents of collection `gettingstarted` into a file called `1MDocs.j
bin/solr export -url http://localhost:8983/solr/gettingstarted -1 -out 1MDocs.json.gz
----
-=== Importing Documents to a Collection
+=== Importing Documents into a Collection
Once you have exported documents in a file, you can use the xref:indexing-guide:indexing-with-update-handlers.adoc[/update request handler] to import them to a new Solr collection.
@@ -1477,3 +1479,42 @@ Once you have exported documents in a file, you can use the xref:indexing-guide:
*Example: import `javabin` files*
`curl -X POST --header "Content-Type: application/javabin" --data-binary @gettingstarted.javabin http://localhost:8983/solr/gettingstarted/update?commit=true`
+
+== Interacting with API
+
+The `api` command will allow you to send an arbitrary HTTP request to a Solr API endpoint.
+
+`bin/solr api -get `
+
+http://localhost:8983/solr/COLL_NAME/sql?stmt=select+id+from+COLL_NAME+limit+10
+
+`bin/solr export -help`
+
+The `bin/solr export` command takes the following parameters:
+
+`get`::
++
+[%autowidth,frame=none]
+|===
+s|Required |Default: none
+|===
++
+Fully-qualified address to a collection.
++
+*Example*: `-get http://localhost:8983/solr/COLL_NAME/sql?stmt=select+id+from+COLL_NAME+limit+10`
+
+=== API
+
+The `api` command will allow you to send an arbitrary HTTP request to a Solr API endpoint.
+If you have configured basicAuth or TLS with your Solr you may find this easier than using a separate tool like `curl`.
+
+[source,bash]
+$ bin/solr api api -get http://localhost:8983/solr/techproducts/select?q=*:*
+
+
+Here is an example of sending a SQL query to the techproducts /sql end point (assumes you start Solr in Cloud mode with the SQL module enabled):
+
+[source,bash]
+$ bin/solr api api -get http://localhost:8983/solr/techproducts/sql?stmt=select+id+from+techproducts+limit+10
+
+Results are streamed to the console.
diff --git a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc
index 04e8338c80b..0e363dd81f1 100644
--- a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc
+++ b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-9.adoc
@@ -73,6 +73,10 @@ Please refer to the https://solr.apache.org/downloads.html[Solr Downloads] site
=== Shard Management
* Solr now provides an xref:deployment-guide:shard-management.adoc#installshard[INSTALLSHARD] API to allow users who have built (per-shard) indices offline to import them into SolrCloud shards.
+== Solr 9.3
+=== Improvements to Solr CLI
+* the bin/solr -i and bin/solr -info removed in favour of bin/solr status command.
+
== Solr 9.2
=== Upgrade to Jetty 10.x
* Solr upgraded to Jetty 10.x from 9.x due to Jetty 9.x is now end of life. Jetty 10.x has a Java 11 minimum and matches Solr 9 minimum Java version. Jetty logging has been replaced with slf4j again matching Solr. See https://webtide.com/jetty-10-and-11-have-arrived/ for additional Jetty 10.x highlights.
@@ -104,7 +108,7 @@ the `solrj-streaming` artifacts under the `org.apache.solr` groupId.
* Loading solr.xml from Zookeeper is deprecated. See xref:configuration-guide:configuring-solr-xml.adoc[Configuring solr.xml].
* The xref:query-guide:analytics.adoc[Analytics Component] has been deprecated. Consider using xref:query-guide:json-facet-api.adoc[JSON Facet API] as a substitute. Please notify the project if there's functionality you need that isn't currently covered by JSON facets.
* The `jaegertracer-configurator` module is deprecated for removal in Solr 10. Users should start migrating to the new `opentelemetry` module.
-
+
== Solr 9.1.1
* Solr no longer accepts all file types for configSets. Please see xref:configuration-guide:config-sets.adoc#forbidden-file-types[ConfigSet Forbidden File Types] for more information.