In this Lucene 6 tutorial, we will learn to use RAMDirectory to run quick examples of POCs because it is not intended to work with huge indexes.
In Lucene, WildcardQuery can be used to execute wildcard based searches on lucene indexes. Learn to use WildcardQuery with example.
Lucene UnifiedHighlighter the highest performing highlighter, especially for large documents. Tutorial to highlight search terms in indexed documents/files.
In this lucene 6 example, we will learn to search indexed documents and highlight searched term in search result using SimpleHTMLFormatter.
In this lucene 6 example , we will learn to create index from text files and then search tokens within indexed documents with respective score of document.
Learn to compile regular expression into java.util.function.Predicate. This can be useful when you want to perform some operation on matched tokens.
Strategy design pattern is behavioral design pattern where we choose a specific implementation of algorithm or task in run time – out of multiple other implementations for same task.
Learn to use Lucene 6 to create, index and search documents using code examples to read, write lucene documents and performing search over them.
JSON.simple is lightweight JSON processing library which can be used to read JSON, write JSON file. Produced JSON will be in full compliance with JSON specification (RFC4627).
Template method design pattern is widely accepted behavioral design pattern to enforce some sort of algorithm (fixed set of steps) in the context of programming. It defines the sequential steps to execute a multi-step algorithm and optionally can provide a default implementation as well (based on requirements). Table of Contents Introduction Problem Statement Solution Code […]
JDOM parser can be used to read XML, parse xml and write XML file after updating content of it. It stores JDOM2 document in memory to read xml values.
AWS (Amazon Web Service) is a cloud computing platform that enables user to access on demand computing services like database storage, virtual cloud server, etc. It works on “pay-as-you-go” model that means – you don’t need to pay upfront for services it offer. You pay for only how much service (mostly bandwidth) you consumed – […]
Learn to read file content into string in java. Examples use Files.readAllBytes, Files.lines and FileReader & BufferedReader to read file content.
Java example to use regular expressions to search and replace unwanted and non-printable characters ASCII characters from text file content.
Java 8 allows to refer method from class or object using class::methodName syntax. Learn about different types of available method references in java 8.
Learn to convert byte to String and String to byte in java – with examples. Conversion between byte array and string may be used in many cases including IO operations, generate secure hashes etc.
Learn to use Integer.parseInt(), Integer.valueOf() and Integer.decode() to convert java string to int value. Also learn to handle NumberFormatException while conversion.
Learn to create enum using strings, iterate over all enum constants, getting single enum value and doing reverse lookup to find enum by string value. Create enum of string constants Example of creating enum with strings. This enum contains deployment environments and their respective URLs. Iterate all enum constants To iterate over all enums, use […]
To convert comma separated string to list in java, you can use below methods. Comma-separated String to List Using Regex You can use regular expression “\\s*,\\s*” to match comma into CSV list and then use String.split() method. Output: [how, to, do, in, java] This resulting List is a fixed-size List backed by the array. It […]
You may need custom serialization in java in may cases. For example, you have legacy java classes which you are not willing to modify for any reason. There can be some design constraints as well. Or even simply, the class is expected to be changed in future releases which could break the deserialization of previously […]