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?
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.
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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With