Skip to content

Commit

Permalink
Merge remote-tracking branch 'es/master' into ccr
Browse files Browse the repository at this point in the history
* es/master: (30 commits)
  [Docs] Fix Java Api index administration usage (#28133)
  Fix eclipse build. (#28236)
  Never return null from Strings.tokenizeToStringArray (#28224)
  Fallback to TransportMasterNodeAction for cluster health retries (#28195)
  [Docs] Changes to ingest.asciidoc (#28212)
  TEST: Update logging for testAckedIndexing
  [GEO] Add WKT Support to GeoBoundingBoxQueryBuilder
  Painless: Add whitelist extensions (#28161)
  Fix daitch_mokotoff phonetic filter to use the dedicated Lucene filter (#28225)
  Avoid doing redundant work when checking for self references. (#26927)
  Fix casts in HotThreads. (#27578)
  Ignore the `-snapshot` suffix when comparing the Lucene version in the build and the docs. (#27927)
  Allow update of `eager_global_ordinals` on `_parent`. (#28014)
  Fix NPE on composite aggregation with sub-aggregations that need scores (#28129)
  `MockTcpTransport` to connect asynchronously (#28203)
  Fix synonym phrase query expansion for cross_fields parsing (#28045)
  Introduce elasticsearch-core jar (#28191)
  #28218: Update the Lucene version for 6.2.0 after backport
  upgrade to lucene 7.2.1 (#28218)
  [Docs] Fix an error in painless-types.asciidoc (#28221)
  ...
  • Loading branch information
martijnvg committed Jan 16, 2018
2 parents 1e330f7 + 67c1f1c commit f2093e7
Show file tree
Hide file tree
Showing 206 changed files with 1,767 additions and 747 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ subprojects {
"org.elasticsearch:rest-api-spec:${version}": ':rest-api-spec',
"org.elasticsearch:elasticsearch:${version}": ':server',
"org.elasticsearch:elasticsearch-cli:${version}": ':server:cli',
"org.elasticsearch:elasticsearch-core:${version}": ':libs:elasticsearch-core',
"org.elasticsearch:elasticsearch-nio:${version}": ':libs:elasticsearch-nio',
"org.elasticsearch.client:elasticsearch-rest-client:${version}": ':client:rest',
"org.elasticsearch.client:elasticsearch-rest-client-sniffer:${version}": ':client:sniffer',
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/version.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
elasticsearch = 7.0.0-alpha1
lucene = 7.2.0
lucene = 7.2.1

# optional dependencies
spatial4j = 0.6
Expand Down
1 change: 1 addition & 0 deletions client/rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ forbiddenApisTest {
}

// JarHell is part of es server, which we don't want to pull in
// TODO: Not anymore. Now in elasticsearch-core
jarHell.enabled=false

namingConventions {
Expand Down
1 change: 1 addition & 0 deletions client/sniffer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ dependencyLicenses {
}

// JarHell is part of es server, which we don't want to pull in
// TODO: Not anymore. Now in elasticsearch-core
jarHell.enabled=false

namingConventions {
Expand Down
1 change: 1 addition & 0 deletions client/test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ forbiddenApisTest {
}

// JarHell is part of es server, which we don't want to pull in
// TODO: Not anymore. Now in elasticsearch-core
jarHell.enabled=false

// TODO: should we have licenses for our test deps?
Expand Down
4 changes: 2 additions & 2 deletions docs/Versions.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:version: 7.0.0-alpha1
:major-version: 7.x
:lucene_version: 7.2.0
:lucene_version_path: 7_2_0
:lucene_version: 7.2.1
:lucene_version_path: 7_2_1
:branch: master
:jdk: 1.8.0_131
:jdk_major: 8
Expand Down
57 changes: 9 additions & 48 deletions docs/java-api/admin/indices/put-mapping.asciidoc
Original file line number Diff line number Diff line change
@@ -1,54 +1,23 @@
[[java-admin-indices-put-mapping]]
:base-dir: {docdir}/../../core/src/test/java/org/elasticsearch/action/admin/indices/create

==== Put Mapping

The PUT mapping API allows you to add a new type while creating an index:

[source,java]
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
client.admin().indices().prepareCreate("twitter") <1>
.addMapping("tweet", "{\n" + <2>
" \"tweet\": {\n" +
" \"properties\": {\n" +
" \"message\": {\n" +
" \"type\": \"text\"\n" +
" }\n" +
" }\n" +
" }\n" +
" }")
.get();
include-tagged::{base-dir}/CreateIndexIT.java[addMapping-create-index-request]
--------------------------------------------------
<1> <<java-admin-indices-create-index,Creates an index>> called `twitter`
<2> It also adds a `tweet` mapping type.


The PUT mapping API also allows to add a new type to an existing index:

[source,java]
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
client.admin().indices().preparePutMapping("twitter") <1>
.setType("user") <2>
.setSource("{\n" + <3>
" \"properties\": {\n" +
" \"name\": {\n" +
" \"type\": \"text\"\n" +
" }\n" +
" }\n" +
"}")
.get();
// You can also provide the type in the source document
client.admin().indices().preparePutMapping("twitter")
.setType("user")
.setSource("{\n" +
" \"user\":{\n" + <4>
" \"properties\": {\n" +
" \"name\": {\n" +
" \"type\": \"text\"\n" +
" }\n" +
" }\n" +
" }\n" +
"}")
.get();
include-tagged::{base-dir}/CreateIndexIT.java[putMapping-request-source]
--------------------------------------------------
<1> Puts a mapping on existing index called `twitter`
<2> Adds a `user` mapping type.
Expand All @@ -57,20 +26,12 @@ client.admin().indices().preparePutMapping("twitter")

You can use the same API to update an existing mapping:

[source,java]
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
client.admin().indices().preparePutMapping("twitter") <1>
.setType("user") <2>
.setSource("{\n" + <3>
" \"properties\": {\n" +
" \"user_name\": {\n" +
" \"type\": \"text\"\n" +
" }\n" +
" }\n" +
"}")
.get();
include-tagged::{base-dir}/CreateIndexIT.java[putMapping-request-source-append]
--------------------------------------------------
<1> Puts a mapping on existing index called `twitter`
<2> Updates the `user` mapping type.
<3> This `user` has now a new field `user_name`

:base-dir!:
4 changes: 2 additions & 2 deletions docs/painless/painless-types.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ to floating point types.
| int | explicit | explicit | explicit | | implicit | implicit | implicit
| long | explicit | explicit | explicit | explicit | | implicit | implicit
| float | explicit | explicit | explicit | explicit | explicit | | implicit
| float | explicit | explicit | explicit | explicit | explicit | explicit |
| double | explicit | explicit | explicit | explicit | explicit | explicit |
|====


Expand Down Expand Up @@ -376,7 +376,7 @@ cast would normally be required between the non-def types.
def x; // Declare def variable x and set it to null
x = 3; // Set the def variable x to the literal 3 with an implicit
// cast from int to def
double a = x; // Declare double variable y and set it to def variable x,
double a = x; // Declare double variable a and set it to def variable x,
// which contains a double
int b = x; // ERROR: Results in a run-time error because an explicit cast is
// required to cast from a double to an int
Expand Down
25 changes: 13 additions & 12 deletions docs/reference/ingest.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@

[partintro]
--
You can use ingest node to pre-process documents before the actual indexing takes place.
This pre-processing happens by an ingest node that intercepts bulk and index requests, applies the
transformations, and then passes the documents back to the index or bulk APIs.
Use an ingest node to pre-process documents before the actual document indexing happens.
The ingest node intercepts bulk and index requests, it applies transformations, and it then
passes the documents back to the index or bulk APIs.

You can enable ingest on any node or even have dedicated ingest nodes. Ingest is enabled by default
on all nodes. To disable ingest on a node, configure the following setting in the `elasticsearch.yml` file:
All nodes enable ingest by default, so any node can handle ingest tasks. You can also create
dedicated ingest nodes. To disable ingest for a node, configure the following setting in the
elasticsearch.yml file:

[source,yaml]
--------------------------------------------------
node.ingest: false
--------------------------------------------------

To pre-process documents before indexing, you <<pipeline,define a pipeline>> that specifies
a series of <<ingest-processors,processors>>. Each processor transforms the document in some way.
For example, you may have a pipeline that consists of one processor that removes a field from
the document followed by another processor that renames a field. Configured pipelines are then stored
in the <<cluster-state,cluster state>>.
To pre-process documents before indexing, <<pipeline,define a pipeline>> that specifies a series of
<<ingest-processors,processors>>. Each processor transforms the document in some specific way. For example, a
pipeline might have one processor that removes a field from the document, followed by
another processor that renames a field. The <<cluster-state,cluster state>> then stores
the configured pipelines.

To use a pipeline, you simply specify the `pipeline` parameter on an index or bulk request to
tell the ingest node which pipeline to use. For example:
To use a pipeline, simply specify the `pipeline` parameter on an index or bulk request. This
way, the ingest node knows which pipeline to use. For example:

[source,js]
--------------------------------------------------
Expand Down
25 changes: 25 additions & 0 deletions docs/reference/query-dsl/geo-bounding-box-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,31 @@ GET /_search
--------------------------------------------------
// CONSOLE

[float]
===== Bounding Box as Well-Known Text (WKT)

[source,js]
--------------------------------------------------
GET /_search
{
"query": {
"bool" : {
"must" : {
"match_all" : {}
},
"filter" : {
"geo_bounding_box" : {
"pin.location" : {
"wkt" : "BBOX (-74.1, -71.12, 40.73, 40.01)"
}
}
}
}
}
}
--------------------------------------------------
// CONSOLE

[float]
===== Geohash

Expand Down
81 changes: 81 additions & 0 deletions libs/elasticsearch-core/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import org.elasticsearch.gradle.precommit.PrecommitTasks

/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

apply plugin: 'elasticsearch.build'
apply plugin: 'nebula.optional-base'
apply plugin: 'nebula.maven-base-publish'
apply plugin: 'nebula.maven-scm'

archivesBaseName = 'elasticsearch-core'

publishing {
publications {
nebula {
artifactId = archivesBaseName
}
}
}

dependencies {
compile "org.apache.logging.log4j:log4j-api:${versions.log4j}"

testCompile "com.carrotsearch.randomizedtesting:randomizedtesting-runner:${versions.randomizedrunner}"
testCompile "junit:junit:${versions.junit}"
testCompile "org.hamcrest:hamcrest-all:${versions.hamcrest}"

if (isEclipse == false || project.path == ":libs:elasticsearch-core-tests") {
testCompile("org.elasticsearch.test:framework:${version}") {
exclude group: 'org.elasticsearch', module: 'elasticsearch-core'
}
}
}

forbiddenApisMain {
// elasticsearch-core does not depend on server
// TODO: Need to decide how we want to handle for forbidden signatures with the changes to core
signaturesURLs = [PrecommitTasks.getResource('/forbidden/jdk-signatures.txt')]
}

if (isEclipse) {
// in eclipse the project is under a fake root, we need to change around the source sets
sourceSets {
if (project.path == ":libs:elasticsearch-core") {
main.java.srcDirs = ['java']
main.resources.srcDirs = ['resources']
} else {
test.java.srcDirs = ['java']
test.resources.srcDirs = ['resources']
}
}
}

thirdPartyAudit.excludes = [
// from log4j
'org/osgi/framework/AdaptPermission',
'org/osgi/framework/AdminPermission',
'org/osgi/framework/Bundle',
'org/osgi/framework/BundleActivator',
'org/osgi/framework/BundleContext',
'org/osgi/framework/BundleEvent',
'org/osgi/framework/SynchronousBundleListener',
'org/osgi/framework/wiring/BundleWire',
'org/osgi/framework/wiring/BundleWiring'
]
1 change: 1 addition & 0 deletions libs/elasticsearch-core/licenses/log4j-api-2.9.1.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7a2999229464e7a324aa503c0a52ec0f05efe7bd
Loading

0 comments on commit f2093e7

Please sign in to comment.