首页 > 代码库 > lucene和es总结

lucene和es总结

一、首先介绍lucene涉及到的排序过程

技术分享

1.1、如何自定义排序对象

你可以自定义collector对象;

亦可以自定义comparator对象;

可以自定义scoredoc对象,决定如何处理结果集合;

1.2、这几种自定义之间有何区别?

自定义collector和comparator有什么区别呢????????

Besides building your own Collector to customize how the results are stored and sorted, another way to customize results sorting 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 have with Collector.

 

 

二、ES master slave介绍

master es中的作用就是:it’s the responsability of the master node to allocate the shards equally among the nodes. 

requests分为两种:index requests和 search requests;两种请求可以落到集群任何一台机器。

三、参考文献

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和es总结