First, the introduction of Lucene involved in the sequencing process
1.1. How to customize Sort objects
You can customize the Collector object;
You can also customize the comparator object;
You can customize the Scoredoc object to decide how to handle the result collection;
1.2. What is the difference between these types of customizations?
What is the difference between custom collector and comparator????????
Besides building your own Collector to customize how the results is stored and sorted, another to customize results s Orting is to implement your own FieldComparator
for SortField
. Note that this customization only deals with the sorting aspect of the result set; It does not give you the flexibility to filter out results, as you would has with Collector.
Second, ES master slave Introduction
The role of Master ES is: It's the responsability of the master node to allocate the shards equally among the nodes.
There are two types of requests: Index requests and search requests, and two requests can fall to any machine in the cluster.
Iii. Reference Documents
http://blog.trifork.com/2013/10/24/how-to-avoid-the-split-brain-problem-in-elasticsearch/
https://github.com/xuxueli/xxl-search/blob/master/xxl-search-client/src/main/java/com/xxl/search/client/es/ Elasticsearchutil.java
Lucene and ES Summary