How to connect Solr 4.4.0 to java application i have created and search data? - solr

I am new user to solr,I want to access and search the MYSQL database tables in java applications via solr.i am able to index my table in solr admin interface. Can anyone tell me how to connect and access MYSQL tables in java application so that i can search data fastly ? I was not able to understand tutorials whatever i found.

Solr provides client libraries in java, ruby and other languagues to help you connect to Solr and query it.
Check for the Java library Solrj to connect and query Solr.
If you are using Frameworks with your projects you might want to check for Spring data as well which will help you seamlessly query and transform Solr response.

So you will need to set up an instance of a Solr Server, SOlr will store and indexes from your database using the DataImportHandler.
http://amac4.blogspot.co.uk/2013/08/configuring-solr-4-data-import-handler.html
Solr creates indexes using Lucene, so you have two options, you can use classes from the Lucene jar file or SolrJ to search your indexes.
OR
You can query Solr by sending http requests. I set-up a Java Web Service so you can snatch some of my code if you need to.
http://amac4.blogspot.co.uk/2013/07/restful-java-web-service-for-solr.html

Related

Find out the number of search query made to my Solr

I have 3 solr instances with zookeeper
Is there a way in Solr to find out the number of search query made to my solr instances? like per day/week/month wise?
Solr doesn't allow you to have statistics grouped by day/month/year.
Despite this, you can integrate your Solr cloud with third-party services like Prometheus and Grafana to store, monitor, and alert historical metrics.
Check this out: https://solr.apache.org/guide/7_3/monitoring-solr-with-prometheus-and-grafana.html
Be sure the metrics are enabled on the solr.xml config file
Install and configure your prometheus-exporter
Install and configure Prometheus and Grafana
Create the query you need on Grafana: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options

Replicate aws cloudsearch data into apache solr

Is there any way to replicate replicate file index data which is aws cloudsearch to apache solr hosted on ec2 real time.
Not really- in order to make sure that all of your original documents are indexed correctly you have to reindex them into Solr in their original form.

Is it possible to manage backups from SolrJ?

I can create / restore Solr backups from Solr via CollectionAdminRequest.Backup and CollectionAdminRequest.Restore.
Looks like it's possible via http api, e.g.:
http://localhost:8983/solr/gettingstarted/replication?command=details&wt=xml
But is it possible to list all backups and drop one by name from SolrJ?
I'm using Solr 7.5.
From what I found, it's not possible to do it from SolrJ directly.
So I've ended up working with HDFS directly. I've configured Solr to use HDFS as backup storage. And from my code I'm accessing it via HDFS client - I can list and remove backups from it.

How to explore HBase data

I am currently doing an app that loads data into HBase, I chose HBase because the data is not structured and therefore using a column based database is recommended.
Once the data is in HBase I thought of integrating Solr to it but I found little information about the subject and no answer for my question "https://stackoverflow.com/questions/36542936/integrating-solr-to-hbase"
So I wanted to ask how I can query data stored in HBase? Spark Streaming doesn't seem to be made for that ..
Any help please ?
Thanks in advance
Assuming that your question is on how to query data from Hbase.
Apache Phoenix Provides a Sql Wrapper over Hbase.
Hive Hbase Integration Hive also provides a Sql Wrapper over Hbase
Spark Hbase Plugin lets your Apache Spark application interact with Apache HBase.

SmartGWT Hibernate Datasource setup for Google Cloud SQL GAE

I am looking for an example of a project where a SmartGWT Hibernate Datasouce is connected to a Google Cloud SQL database using GAE as the server. I would be surprised to be the first one in this world to have attempted.
We'd recommend using SQLDataSource instead (simpler, faster, more flexible). Google documents appropriate JDBC settings here:
https://developers.google.com/appengine/docs/java/cloud-sql/developers-guide#use_with_lang
SmartGWT documents how to provide JBDC settings to SQLDataSource here:
http://www.smartclient.com/smartgwtee/javadoc/com/smartgwt/client/docs/SqlSettings.html
You would use MySQL as the database type since CloudSQL is MySQL-compatible.
If you choose to use Hibernate, we haven't tried this, but presumably the same JDBC settings can be provided to Hibernate - see Hibernate docs.

Resources