Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Pravin Shelar
Problem with solr searching from database
February 13, 2012 1:02 AM
Answer

Pravin Shelar

Rank: New Member

Posts: 3

Join Date: February 13, 2012

Recent Posts

I am new Solr user.
I am unable access data from database.
I have done all steps for Data Import Handler and modified solrconfig.xml and created my-data-config.xml.
After that I can see DataImportHandleer Devlopment Console window by putting http://localhost:8983/solr/admin/dataimport.jsp in url.
But I can not see result of query which I have mention in my-data-config.xml.It only show my-data-config.xml file contains.
I am not getting how to fetch data from database.
Please give me proper steps and if possible videos/images of how actually it look like.
Attachments: solr.bmp (3,060.1k), untitled.bmp (3,060.1k)
Bijan Vakili
RE: Problem with solr searching from database
February 13, 2012 9:17 PM
Answer

Bijan Vakili

Rank: Expert

Posts: 354

Join Date: March 10, 2009

Recent Posts

Hey,

Please give us clear steps you took so we can try to reproduce the issue. For example: Step 1. Setup plain vanilla Liferay. Step 2. Unzip solr.zip, etc...

Did you see and follow the instructions at following URI already?

http://www.liferay.com/community/wiki/-/wiki/Main/Integrate+Solr+with+Liferay+portal
Pravin Shelar
RE: Problem with solr searching from database
February 14, 2012 12:26 AM
Answer

Pravin Shelar

Rank: New Member

Posts: 3

Join Date: February 13, 2012

Recent Posts

I have done following step for importing data from Mysql on windows XP:
1. Install apache-solr-1.4.1.zip file
2. After that I have fire "java -jar start.jar" command on going through \apache-solr-1.4.1>example folder.
Then I can see Solr's admin window by typing in url "http://localhost:8983/solr/admin/"
3.After that I have copied "mysql-connector-java-5.1.18-bin.jar" and "apache-solr-dataimporthandler-extras-3.4.0.jar" files in "C:\apache-solr-1.4.1\example\lib" folder.
4.Then I have done following changes in "solrconfig.xml" file which is located at C:\apache-solr-1.4.1\example\solr\conf

<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">C:\apache-solr-1.4.1/example/solr/conf/my-data-config.xml</str>
</lst>
</requestHandler>
5.Then I have created "my-data-config.xml" file in same folder which contains following data:

<dataConfig>
<dataSource name="pravindb"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/pravindb"
user="root"
password="root"
batchSize="-1" />
<document>
<entity name="ename" dataSource="pravindb" pk="eno"
query="
select ename from emp where eno=1"
>
</entity>
</document>
</dataConfig>


where:pravindb is my database name
emp is my table name with field eno and ename and eno is primary key

5.After all this changes when I type "http://localhost:8983/solr/admin/dataimport.jsp?handler=/dataimport"
I can see 1.bmp image
In that I can see following message:
<str name="Total Rows Fetched">1</str>

After that I couldn't understand anything that is whether I have fetched data or not. If fetch where is the output of the query which I have mentioned in
"my-data-config.xml" file
Please give me any redymade API if available.
I am referring "Solr 1.4 Enterprise Search Server" book by David Smiley,Eric Pugh.
Attachments: 1.bmp (3,060.1k)
Bijan Vakili
RE: Problem with solr searching from database
February 14, 2012 1:00 PM
Answer

Bijan Vakili

Rank: Expert

Posts: 354

Join Date: March 10, 2009

Recent Posts

Ok; thanks for the information. Unfortunately I do not have enough Solr experience to help you on this, but would recommend you to check out the Solr discussion page at following URI:

http://lucene.apache.org/solr/discussion.html

The Solr user mailing list etc. there may be better option. If you have Liferay-specific question, we'd be happy to help you out here.
Hitoshi Ozawa
RE: Problem with solr searching from database
February 14, 2012 2:44 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Pravin, this is a Liferay forum. Somebody may be able to help you if you have question on how to use Solr plugin for Liferay.
If you just have question on how to use Solr, it would be better to post your question to the Solr/Lucune forum as Bijan said.

I only reply to questions posted to the right forum.
Pravin Shelar
RE: Problem with solr searching from database
February 17, 2012 11:44 PM
Answer

Pravin Shelar

Rank: New Member

Posts: 3

Join Date: February 13, 2012

Recent Posts

I could not understand anything on link that you have told me.
Please give any other link/Block/Forum for Apache Solr.
Hitoshi Ozawa
RE: Problem with solr searching from database
February 18, 2012 5:05 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Subscribe to solr-user@lucene and post your questions concerning Solr there instead of here.

http://lucene.apache.org/solr/discussion.html