Elasticsearch6.0 significant changes in the Java API

Source: Internet
Author: User

Elasticsearch6.0 Java API Major changes

Recent projects have used the Elasticsearch,es version iteration speed very quickly, here to record the official release of the 6.0 version of the major changes

  • The SetSource () method requires Xcontenttype

    Previously SetSource methods and other methods that accepted the Byte/string type as the source of the object could not be specified Xcontenttype,

    Automatic detection of content types is no longer used, and now when providing bytes or string-type source, these methods need to specify Xcontenttype

    As an additional parameter

  • Deletebyqueryrequest requires a clear query statement

    In previous versions of Elasticsearch, Deletebyqueryrequest allowed not to set a definite query,

    The Match_all statement (query) is used by default and all documents are deleted, starting with version 6.0.0,

    Deletebyqueryrequest need to set a definite match statement (query)

  • The Getcountasstring () method of internalstats and stats is removed

    • The count value in the statistical aggregation represents the count value of the hit document, which does not need to be formatted as a string version.

    This method is deprecated in version 5.4,

    • If you need a count value of type string, use String.valueof (GetCount ()) instead
  • Actionrequestbuilder#execute return value changed to Actionfuture

    When a request is sent by using request Builders (Client.preparesearch (). Execute ())

    May go to call AddListener again to return listenableactionfuture. Along with this change, the return value is now

    As the unified actionfuture substitution returned by the client method, you may not need to contact the listener's expectations,

    The Execute method takes a listener (listener) as a parameter to replace the previous method

  • Terms.order and Histogram.order classes are replaced by Bucketorder

    • terms, histogram, date_histogram, and other aggregated code have been refactored to use the common code of the sorted bucket.

    • You must use the Bucketorder class to replace Terms.order and Histogram.order.

    • The static method of the Bucket.order class must be called instead of direct access to the order internal instance (Bucketorder.count (Boolean), Bucketorder.aggregation (String,boolean)).

    • Use Bucketorder.key (Boolean) to rely on _term to sort terms aggregated buckets (buckets)

  • The Gettookinmillis () method is removed in Builkreponse, SearchResponse, and Termvectorresponse

    In the Bulkresponse, SearchResponse, and Termvectorresponse classes, the Gettookinmillis () method has been removed,

    The Gettookinmillis () method was very early replaced by Gettook () Getmillis ().

  • GetField and Searchhitfield were replaced by Documentfield.

    The original GetField and Searchfield classes have the same member variables and methods and are now unified as Documentfield

  • Some aggregation class file-owning package changes

    • Some derivative class files about sort aggregation (GEO_DISTANCE,DATE,IP) are moved to

    Org.elasticsearch.search.aggregations.bucket.range under the bag.

    • The class file under the original Org.elasticsearch.search.aggregations.bucket.terms.support package

    Move to the org.elasticsearch.search.aggregations.bucket.terms Package

    • The class file for Filter Aggregation has been moved to the org.elasticsearch.search.aggregations.bucket.filter Package
  • Percentileranksaggregationbuilder change of the constructor function

    Percentile line aggregation, you now need to pass the non-null, non-null double array that you want to sort, into the builder constructor,

    Instead of being configured by setter, the previously corresponding setter values () method has been removed

Elasticsearch6.0 significant changes in the Java API

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.