Venky Rao

Solr : Search On Lucene — Replicated

Prereq: Pls have docker installed

Photo by Austin Chan on Unsplash

$ docker run — name my_solr -d -p 8983:8983 -t solr

The next step is create a core (index home):
$ docker exec -it — user=solr my_solr bin/solr create_core -c gettingstarted

And now load some data into that core/collection:

$ docker exec -it — user=solr my_solr bin/post -c gettingstarted example/exampledocs/manufacturers.xml

$ curl http://localhost:8983/solr/gettingstarted/get?id=apple

{“doc”:{“id”:”apple”,
“compName_s”:”Apple”,
“address_s”:”1 Infinite Way, Cupertino CA”,“_version_”:1736922512774660096}}

>> One may manually add a core and upload data as well.

bash-3.2$ curl http://localhost:8983/solr/demo/update -d ‘
> [
> {“id” : “book1”,
> “title_t” : “The Way of Kings”,
> “author_s” : “Brandon Sanderson”
> }
> ]’

Output:
{
“responseHeader”:{“status”:0, “QTime”:14}}

bash-3.2$ curl http://localhost:8983/solr/demo/get?id=book1

{
“doc”:
{“id”:”book1",
“title_t”:”The Way of Kings”,
“author_s”:”Brandon Sanderson”,
“_version_”:1736923070086512640}}

Thanks for reading.

--

--