I am a programmer but I hate grammar. Here you will find what I did, doing , will do ... Scattered pieces of knowledge that I have deleted from my mind to the trash bin through out my boring daily coding life. I will also report some of my failures in life so dear to me not success, because I have always learnt much only when I fail.
Wednesday, January 25, 2023
what is the difference between using the SolrJ and Data Import Handler to synchronize Solr with the datatabase ?
SolrJ is a Java client library for communicating with Solr, while the Data Import Handler (DIH) is a module within Solr that allows for importing data from various data sources, including databases, into Solr.
The main difference between the two is in how they import data into Solr.
SolrJ allows you to interact with Solr using a Java API, allowing you to add, delete, or update documents in Solr directly from your Java code. This can be useful if you have a custom data pipeline or application that needs to update Solr in real-time.
On the other hand, the DIH provides a way to import data into Solr from various data sources, including databases, without writing any code. The DIH can be configured to periodically fetch data from the database and update Solr, or it can be triggered to run on demand. It also supports incremental updates, so it only imports the data that has changed since the last import.
SolrJ is a Java client library for interfacing with Solr, while the Data Import Handler (DIH) is a feature provided by Solr for indexing data from external sources such as databases.
Pros of SolrJ:
Provides a Java API for interacting with Solr, allowing for easy integration with other Java-based systems
Allows for fine-grained control over how data is indexed and queried
Can handle large volumes of data
Cons of SolrJ:
Requires code to be written to interface with the data source and index it into Solr
Can be more complex to set up and maintain than using the DIH
Pros of Data Import Handler:
Can be configured through the Solr web interface, making it easy to set up and maintain
Can handle a variety of data sources, including databases, XML, and CSV files
Can schedule regular imports of data to keep the index up to date
Cons of Data Import Handler:
May not provide as much flexibility as using SolrJ to index data
Can be less efficient than using SolrJ for large-scale data import.
So, in summary, SolrJ is a way to communicate with Solr using Java API and update it in real-time, while DIH is a module within Solr that allows you to import data from various data sources, including databases, into Solr.
Sunday, December 18, 2022
001# Vaadin Hello World with Eclipse Maven and Jetty SOLVED
In this tutorial, I show you how create a basic hello world on Vaadin with eclipse, maven and jetty, step by step. See the video in my channel and the snippet in this blog.
POM.xml:
4.0.0 org.moumie Vaadinlet03 0.0.1-SNAPSHOT war Vaadinlet03 Maven Webapp http://www.example.com UTF-8 1.8 1.8 7.7.1 7.7.1 9.3.9.v20160517 vaadin-addons http://maven.vaadin.com/vaadin-addons vaadin-snapshots https://oss.sonatype.org/content/repositories/vaadin-snapshots/ false true com.vaadin vaadin-bom ${vaadin.version} pom import junit junit 4.11 test javax.servlet javax.servlet-api 3.1.0 provided com.vaadin vaadin-server com.vaadin vaadin-push com.vaadin vaadin-client-compiled com.vaadin vaadin-themes org.eclipse.jdt.core.compiler ecj 4.6.1 com.vaadin vaadin-client-compiler ${vaadin.version} provided Vaadinlet03 maven-clean-plugin 3.1.0 maven-resources-plugin 3.0.2 maven-compiler-plugin 3.8.0 maven-surefire-plugin 2.22.1 maven-war-plugin 3.2.2 maven-install-plugin 2.5.2 maven-deploy-plugin 2.8.2 org.eclipse.jetty jetty-maven-plugin ${jetty.plugin.version} 2 vaadin-prerelease false vaadin-prereleases http://maven.vaadin.com/vaadin-prereleases vaadin-prereleases http://maven.vaadin.com/vaadin-prereleases
import javax.servlet.annotation.WebServlet;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
public class Vaadinlet03UI extends UI{
private static final long serialVersionUID = 1L;
@Override
protected void init(VaadinRequest request) {
final VerticalLayout layout = new VerticalLayout();
Label label = new Label("Hello World Vaadin !");
layout.addComponent(label);
layout.setMargin(true);
layout.setSpacing(true);
setContent(layout);
}
@WebServlet(urlPatterns = "/*", name = "Vaadinlet03UIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = Vaadinlet03UI.class, productionMode = false)
public static class Vaadinlet03UIServlet extends VaadinServlet {
}
}
Sunday, May 23, 2021
Sunday, May 16, 2021
Subscribe to:
Posts (Atom)