Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate solr with mySql

Tags:

mysql

solr

How can I integrate solr with mysql. I have deployed the solr server and all, so what I have to do next for performing search?

like image 850
Nikhil Dinesh Avatar asked May 17 '11 06:05

Nikhil Dinesh


People also ask

Can you use SOLR as a database?

Yes, you can use SOLR as a database but there are some really serious caveats : SOLR's most common access pattern, which is over http doesnt respond particularly well to batch querying. Furthermore, SOLR does NOT stream data --- so you can't lazily iterate through millions of records at a time.

Does SOLR need a database?

Solr is a search engine at heart, but it is much more than that. It is a NoSQL database with transactional support. It is a document database that offers SQL support and executes it in a distributed manner.


1 Answers

Here is the ans

First have to do a full import which will index all the data in the database(indexing will make the search faster)full import can be started by hitting the below mentioned url in the browser.

http://localhost:8983/solr/dataimport?command=full-import

If the database is so big and if we are performing full import several times it will take lots of time to avoid that we can do partial import by hitting the below url

localhost:8983/solr/dataimport?command=delta-import

When delta-import command is executed, it reads the start time stored in conf/dataimport.properties. It uses that timestamp to run delta queries and after completion, updates the timestamp in conf/dataimport.properties

After performing imports our solr is ready to perform search we can simply hit this

http://localhost:8983/solr/select/?q=chair&version=2.2&start=0&rows=10&indent=on

url in the browser to get the result(here I am searching for the chairs, it will return 10 results)

like image 163
Nikhil Dinesh Avatar answered Sep 22 '22 00:09

Nikhil Dinesh