You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2021/10/26 19:01:39 UTC

[GitHub] [lucene-solr] magibney commented on a change in pull request #2594: SOLR-14726: Initial draft of a new quickstart guide

magibney commented on a change in pull request #2594:
URL: https://github.com/apache/lucene-solr/pull/2594#discussion_r736836224



##########
File path: solr/solr-ref-guide/src/quickstart.adoc
##########
@@ -0,0 +1,140 @@
+= Quickstart Guide
+:experimental:
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+Here's a quickstart guide to start Solr, add some documents and perform some searches.
+
+== Starting Solr
+
+Start a Solr node in cluster mode (SolrCloud mode)
+
+[source,subs="verbatim,attributes+"]
+----
+$ bin/solr -c
+
+Waiting up to 180 seconds to see Solr running on port 8983 [\]
+Started Solr server on port 8983 (pid=34942). Happy searching!
+----
+
+To start another Solr node and have it join the cluster alongside the first node,
+
+[source,subs="verbatim,attributes+"]
+----
+$ bin/solr -c -z localhost:9983 -p 8984
+----
+
+An instance of the cluster coordination service, i.e. Zookeeper, was started on port 9983 when the first node was started. To start Zookeeper separately, please refer to XXXX.
+
+== Creating a collection
+
+Like a database system holds data in tables, Solr holds data in collections. A collection can be created as follows:
+
+[source,subs="verbatim,attributes+"]
+----
+$ curl --request POST \
+  --url http://localhost:8983/api/collections \
+  --header 'Content-Type: application/json' \
+  --data '{
+	"create": {
+		"name": "techproducts",
+		"numShards": 1,
+		"replicationFactor": 1
+	}
+}'
+----
+
+== Indexing documents
+
+A single document can be indexed as:
+[source,subs="verbatim,attributes+"]
+----
+$ curl --request POST \
+  --url 'http://localhost:8983/api/collections/techproducts/update' \
+  --header 'Content-Type: application/json' \
+  --data '  {
+    "id" : "978-0641723445",
+    "cat" : ["book","hardcover"],
+    "name" : "The Lightning Thief",
+    "author" : "Rick Riordan",
+    "series_t" : "Percy Jackson and the Olympians",
+    "sequence_i" : 1,
+    "genre_s" : "fantasy",
+    "inStock" : true,
+    "price" : 12.50,
+    "pages_i" : 384
+  }'
+----
+
+Multiple documents can be indexed in the same request:
+[source,subs="verbatim,attributes+"]
+----
+$ curl --request POST \
+  --url 'http://localhost:8983/api/collections/techproducts/update' \
+  --header 'Content-Type: application/json' \
+  --data '  [
+  {
+    "id" : "978-0641723445",
+    "cat" : ["book","hardcover"],
+    "name" : "The Lightning Thief",
+    "author" : "Rick Riordan",
+    "series_t" : "Percy Jackson and the Olympians",
+    "sequence_i" : 1,
+    "genre_s" : "fantasy",
+    "inStock" : true,
+    "price" : 12.50,
+    "pages_i" : 384
+  }
+,
+  {
+    "id" : "978-1423103349",
+    "cat" : ["book","paperback"],
+    "name" : "The Sea of Monsters",
+    "author" : "Rick Riordan",
+    "series_t" : "Percy Jackson and the Olympians",
+    "sequence_i" : 2,
+    "genre_s" : "fantasy",
+    "inStock" : true,
+    "price" : 6.49,
+    "pages_i" : 304
+  }
+]'
+----
+
+A file containing the documents can be indexed as follows:
+[source,subs="verbatim,attributes+"]
+----
+$ curl -X POST -d @example/exampledocs/books.json http://localhost:8983/api/collections/techproducts/update
+----
+
+== Commit
+After documents are indexed into a collection, they are not immediately available for searching. In order to have them searchable, a commit operation (also called `refresh` in other search engines like OpenSearch etc.) is needed. Commits can be scheduled at periodic intervals using auto-commits as follows.

Review comment:
       Makes sense to me as a point of reference. It might be more economical to say "(also called `refresh` in ElasticSearch/OpenSearch)" ... unless there are other search engines that refer to this concept as "refresh"?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org