Installation is straightforward and hence will not be covered. I use Solr version 5.1.0 and find that the Apache Solr Reference Guide 5.1 does not seems up to date and hence I
have to rely on the help provided by the solr and post binary. This small write-up is for my own record and for anyone who may find it useful.
$ bin/solr create -c test123
Failed to determine the port of a local Solr instance, cannot create test123!
$ bin/solr start -p 8984
Started Solr server on port 8984 (pid=6694). Happy searching!
$ bin/solr create -c test123
WARN - 2015-05-26 14:52:54.557; org.apache.solr.util.SolrCLI; Request to http://localhost:8984/solr/admin/info/system failed due to: Connection refused, sleeping for 5 seconds before re-trying the request ...
Setup new core instance directory:
/usr/home/fs/solr-5.1.0/server/solr/test123
Creating new core 'test123' using command:
http://localhost:8984/solr/admin/cores?action=CREATE&name=test123&instanceDir=test123
{
"responseHeader":{
"status":0,
"QTime":4023},
"core":"test123"}
$ bin/solr status
Found 1 Solr nodes:
Solr process 6694 running on port 8984
{
"solr_home":"/usr/home/fs/solr-5.1.0/server/solr/",
"version":"5.1.0 1672403 - timpotter - 2015-04-09 10:37:54",
"startTime":"2015-05-26T02:52:50.118Z",
"uptime":"0 days, 0 hours, 6 minutes, 29 seconds",
"memory":"14 MB (%2.9) of 490.7 MB"}
go to http://localhost:8983/solr/#/test123/query?q=video to query about video,
Then i realise i need to remove the # in the url
http://localhost:8983/solr/test123/query?q=video&fl=id,name,price
i got a JSON response:
{
"responseHeader":{
"status":0,
"QTime":1,
"params":{
"q":"video",
"fl":"id,name,price"}},
"response":{"numFound":3,"start":0,"docs":[
{
"id":"MA147LL/A",
"name":["Apple 60 GB iPod with Video Playback Black"],
"price":[399.0]},
{
"id":"EN7800GTX/2DHTV/256M",
"name":["ASUS Extreme N7800GTX/2DHTV (256 MB)"],
"price":[479.95]},
{
"id":"100-435805",
"name":["ATI Radeon X1900 XTX 512 MB PCIE Video Card"],
"price":[649.99]}]
}}
using http://localhost:8983/solr/test123/select?q=video&fl=id,name,price
i got a XML response
0 1 video id,name,price MA147LL/A Apple 60 GB iPod with Video Playback Black 399.0 EN7800GTX/2DHTV/256M ASUS Extreme N7800GTX/2DHTV (256 MB) 479.95 100-435805 ATI Radeon X1900 XTX 512 MB PCIE Video Card 649.99
To add more documents to be indexed, use the same command as above, i.e.
bin/post -c test123 example/goodies-sg/file.htm
That's all for now... This is only the beginning, and Solr really has a lot to offer, but so far the steps here should allow me to go further.
Fook Sheng
have to rely on the help provided by the solr and post binary. This small write-up is for my own record and for anyone who may find it useful.
$ bin/solr create -c test123
Failed to determine the port of a local Solr instance, cannot create test123!
$ bin/solr start -p 8984
Started Solr server on port 8984 (pid=6694). Happy searching!
$ bin/solr create -c test123
WARN - 2015-05-26 14:52:54.557; org.apache.solr.util.SolrCLI; Request to http://localhost:8984/solr/admin/info/system failed due to: Connection refused, sleeping for 5 seconds before re-trying the request ...
Setup new core instance directory:
/usr/home/fs/solr-5.1.0/server/solr/test123
Creating new core 'test123' using command:
http://localhost:8984/solr/admin/cores?action=CREATE&name=test123&instanceDir=test123
{
"responseHeader":{
"status":0,
"QTime":4023},
"core":"test123"}
$ bin/solr status
Found 1 Solr nodes:
Solr process 6694 running on port 8984
{
"solr_home":"/usr/home/fs/solr-5.1.0/server/solr/",
"version":"5.1.0 1672403 - timpotter - 2015-04-09 10:37:54",
"startTime":"2015-05-26T02:52:50.118Z",
"uptime":"0 days, 0 hours, 6 minutes, 29 seconds",
"memory":"14 MB (%2.9) of 490.7 MB"}
should have start server with default port of 8983, so
$ bin/solr stop
Sending stop command to Solr running on port 8984 ... waiting 5 seconds to allow Jetty process 6694 to stop gracefully.
$ bin/post -c test123 example/exampledocs/*.xml
$ bin/solr start
Started Solr server on port 8983 (pid=7326). Happy searching!
$ bin/post -c test123 example/exampledocs/*.xml
java -classpath /usr/home/fs/solr-5.1.0/dist/solr-core-5.1.0.jar -Dauto=yes -Dc=test123 -Ddata=files org.apache.solr.util.SimplePostTool example/exampledocs/gb18030-example.xml example/exampledocs/hd.xml example/exampledocs/ipod_other.xml example/exampledocs/ipod_video.xml example/exampledocs/manufacturers.xml example/exampledocs/mem.xml example/exampledocs/money.xml example/exampledocs/monitor.xml example/exampledocs/monitor2.xml example/exampledocs/mp500.xml example/exampledocs/sd500.xml example/exampledocs/solr.xml example/exampledocs/utf8-example.xml example/exampledocs/vidcard.xml
SimplePostTool version 5.0.0
Posting files to [base] url http://localhost:8983/solr/test123/update...
Entering auto mode. File endings considered are xml,json,csv,pdf,doc,docx,ppt,pptx,xls,xlsx,odt,odp,ods,ott,otp,ots,rtf,htm,html,txt,log
POSTing file gb18030-example.xml (application/xml) to [base]
POSTing file hd.xml (application/xml) to [base]
POSTing file ipod_other.xml (application/xml) to [base]
POSTing file ipod_video.xml (application/xml) to [base]
POSTing file manufacturers.xml (application/xml) to [base]
POSTing file mem.xml (application/xml) to [base]
POSTing file money.xml (application/xml) to [base]
POSTing file monitor.xml (application/xml) to [base]
POSTing file monitor2.xml (application/xml) to [base]
POSTing file mp500.xml (application/xml) to [base]
POSTing file sd500.xml (application/xml) to [base]
POSTing file solr.xml (application/xml) to [base]
POSTing file utf8-example.xml (application/xml) to [base]
POSTing file vidcard.xml (application/xml) to [base]
14 files indexed.
COMMITting Solr index changes to http://localhost:8983/solr/test123/update...
Time spent: 0:00:01.139
Somehow the link provided in the guide didn't work, but i manage to guess the url to use for query:
Then i realise i need to remove the # in the url
http://localhost:8983/solr/test123/query?q=video&fl=id,name,price
i got a JSON response:
{
"responseHeader":{
"status":0,
"QTime":1,
"params":{
"q":"video",
"fl":"id,name,price"}},
"response":{"numFound":3,"start":0,"docs":[
{
"id":"MA147LL/A",
"name":["Apple 60 GB iPod with Video Playback Black"],
"price":[399.0]},
{
"id":"EN7800GTX/2DHTV/256M",
"name":["ASUS Extreme N7800GTX/2DHTV (256 MB)"],
"price":[479.95]},
{
"id":"100-435805",
"name":["ATI Radeon X1900 XTX 512 MB PCIE Video Card"],
"price":[649.99]}]
}}
using http://localhost:8983/solr/test123/select?q=video&fl=id,name,price
i got a XML response
To add more documents to be indexed, use the same command as above, i.e.
bin/post -c test123 example/goodies-sg/file.htm
That's all for now... This is only the beginning, and Solr really has a lot to offer, but so far the steps here should allow me to go further.
Fook Sheng
5 comments:
One of a car’s most crucial safety features is its tyres. While many drivers regularly check tread wear and tyre pressure, the sidewall of a tyre is often overlooked. Unfortunately, sidewall damage is a common problem that can compromise the safety and performance of your vehicle. Understanding what causes tyre sidewall damage and whether it can be repaired can help drivers make better decisions and avoid dangerous situations on the road.
https://247mobiletyreservicemelbourne.com.au/blog/what-causes-tyre-sidewall-damage-and-can-it-be-repaired/
When it comes to securing a home loan, one of the first decisions you’ll face is whether to go through a bank or an independent mortgage broker in North Kellyville. Both have their advantages, but many homebuyers in the area are increasingly turning to mortgage brokers for a variety of reasons. But what exactly sets mortgage brokers apart from traditional bank loans? In this article, we’ll explore the key differences, benefits, and why you might prefer an independent mortgage broker over a bank loan when looking to buy your dream home in North Kellyville.
https://kandidloans.com.au/why-to-prefer-mortgage-brokers-in-north-kellyville/
A swimming pool is meant to be a place of relaxation—not stress. But when something suddenly goes wrong, it can quickly turn into a serious problem. From leaking water to faulty equipment, pool emergencies can damage your investment, increase costs, and even pose safety risks if not handled quickly.
https://adelaideaquaboys.com.au/emergency-pool-repairs-when-should-you-call-experts/
Soft Play Hire: Planning a kids’ party in Melbourne is exciting, but when it comes to hiring soft play, parents often run into stress, confusion, and unexpected issues. Soft play setups are perfect for toddlers and young children, but making sure everything goes smoothly requires a bit of planning.
https://boujeebyashtons.com.au/soft-play-hire-problems-heres-how-parents-can-easily-fix-them/
Minor medical procedures are an important part of modern healthcare. They allow doctors to diagnose, treat and manage a variety of common health conditions quickly and safely without the need for major surgery or hospital admission. These procedures are usually simple, minimally invasive, and performed in a medical clinic by qualified healthcare professionals.
https://balgowlahvillagemedicalpractice.com.au/minor-procedures-in-primary-care/
Post a Comment