A while back a had a little time to play with Solr, and was instantly blown away by the performance we could achieve on some of our bigger datasets.
Here is some of my initial setup and configuration learnings to maybe help someone get it up and running a little faster.
Starting with setting both up on windows.
Download and extract Apache Tomcat and Solr and copy into your working folders.
Tomcat Setup
If you want tomcat as a service install it using the following:
bin\service.bat install
Edit the tomcat users under conf.:
If you are going to query Solr using international characters (>127) using HTTP-GET, you must configure Tomcat to conform to the URI standard by accepting percent-encoded UTF-8.
Add: URIEncoding="UTF-8"
to the conf/server.xml
Copy the contents of the example\solr your solr home directory D:\Java\apache-solr-3.6.0\home
create the code fragment on $CATALINA_HOME/conf/Catalina/localhost/solr.xml pointing to your solr home.
Startup tomcat, login, deploy the solr.war.
Solr Setup
It should be available at http://localhost:8080/solr/admin/
To create a quick test using SolrJ the creates and reads data:
Grab the following Maven Libs:
JUnit test:
Adding data directly from the DB
Firstly you need to add the relevant DB libs to the add classpath. Then create data-config.xml as below, if you require custom fields, those can be specified under the fieldstag in the schema.xml shown below the dataconfig.xml
A custom field in the schema.xml:
Add in the solrconfig.xml make sure to point the the data-config.xml, the handler has to be registered in the solrconfig.xml as follows.
Once that is all setup a full import can be done with the following:
http://localhost:8080/solr/admin/dataimport?command=full-import
Then you should be good to go with some lightning fast data retrieval.
Wednesday, October 17, 2012
Subscribe to:
Post Comments (Atom)
Popular Posts
-
I have recently been slacking on content on my blog, between long stressful hours at work and to the wonderful toy that is an iPhone, I have...
-
I make no claim to be a "computer scientist" or a software "engineer", those titles alone can spark some debate, I regar...
-
I saw an article (well more of a rant) the other day, by Rob Williams Brain Drain in enterprise Dev . I have to say, I do agree with some o...
-
This series of posts will be about me getting to grips with JBoss Drools . The reasoning behind it is: SAP bought out my company's curre...
-
Update: Check out my updated re-certification on the new 2019 exam... here Let me start by saying, for this certification I studied and...
It's excellent to your publish with example which is very useful to me and i got more concept in my web page.
ReplyDeleteThanks, nice post
ReplyDelete
ReplyDeleteHaryana Police Recrutiment
MP Police Recruitment
Karnataka Police Recruitment
CG Police Recruitment
Mua vé máy bay tại Aivivu, tham khảo
ReplyDeletekinh nghiệm mua vé máy bay đi Mỹ giá rẻ
khi nào có chuyến bay từ mỹ về việt nam
vé máy bay giá rẻ nhật việt
lich bay tu duc ve viet nam
giá vé máy bay từ Toronto đến việt nam
ve may bay tu han quoc ve viet nam
chuyến bay chuyên gia
Setting up and exploring Apache Solr is a rewarding venture. Its robust search capabilities and scalability make it a valuable tool. How Can Uninstall Configuring Solr and delving into its features allows for efficient and powerful searching.
ReplyDelete