Skip to main content

Posts

Showing posts from August, 2018

Apache Solr Search Framework

Introduction: SOLR stands for Searching On Lucene with Replication . Its main functionalities are indexing and searching. Solr is an open source enterprise search server/ web application Created by Yonik Seeley in 2004. In 2012 4.0 version with Cloud support. Solr uses lucene search library and extends it. Solr exposes lucene Java API's as RESTful services. Terminology: Solr Instance: In Apache Solr, a Solr Instance is an instance a Solr running in the JVM. In Standalone mode, Solr contains only one instance. Solr Core: In Apache Solr, a Solr Core is also known as simply “Core”. In other words, a Solr Core = an instance of Apache Lucene Index + Solr Configuratio. Indexing: In Apache Lucene or Solr, Indexing is a technique of adding Document’s content to Solr Index so that we can search them easily. Apache Solr uses Apache Lucene Inverted Index technique to Index it’s documents. That’s why Solr provides very fast searching feature. Document: Solr...

Restful API for Beginners

Introduction: Everyone is saying Rest API. Sometimes people say  only API to rest apis.RESTful API is for accessing blah blah service or to do blah blah functionality. In corporate world, fresher get confused when seniors give them task to create new api to call blah blah service or to do blah blah functionality. So what is this REST API? REST (REpresentational State Transfer) is an architectural style, and an approach to communications.Using this REST whatever functionality we create known as REST API. We can implement  rest-api using various providers but usually people use Jersey and Spring . As per my choice personally I would like to use jersey which keep code neat and clean. Rest follows client-server architecture with Front Controller Design Pattern. It completely depends on http protocol .REST implementation is very easy and run in  less memory compared to SOAP. Rest Support following parameter techniques to pass input for our web service...

Exception Handling in RESTful Web Services

Introduction Exception Handling in RESTful webservices is very interesting as well as important topic while writing RESTful web services. Whenever any exception occurs in our web service, by default it will show error with HTTP error code with the description which user can’t understand easily. Why one should handle Exceptions in Restful Web services? User should understand if any error occurred in the system and he/she should easily understand what to do next so that error will not come again as most of the error are due to wrong input given by user and if sometimes error is due to our application he should clearly know that. How to Handle Exceptions in Restful Web services? In RESTful web services, usually response will be in JSON format. So, we need to create response object which will give error in JSON format. Woooooh So let’s get hand dirty. ------------------------------------------------------------------------------------------------- //ErrorRes...