Commit Graph

194 Commits

Author SHA1 Message Date
Christoph Büscher 712473b558
[Docs] Replace InetSocketTransportAddress with TransportAdress (#30673)
The former class has been removed in 6.0, the documentation code
snippets should be updated accordingly.
2018-05-17 14:23:08 +02:00
lukens 9434f25ee3 [Docs] Update code snippet in has-child-query.asciidoc (#30510)
Changed `InetSocketTransportAddress` to `TransportAddress`, as that 
seems to be  the thing now.
2018-05-16 09:25:48 +02:00
Adrien Grand 3bdfc8f3fb
Upgrade to lucene-7.3.0-snapshot-98a6b3d. (#29298)
Most notable changes include:
 - this release doesn't have the 7.2.1 version constant so I had to create one
 - spatial4j and jts were upgraded
2018-04-03 09:27:14 +02:00
Martijn van Groningen 069a876542
Added minimal docs for reindex api in java-api docs
Additionally:
* Included the existing update by query java api docs in java-api docs.
  (for some reason it was never included, it needed some tweaking and
  then it was good to go)
* moved delete-by-query / update-by-query code samples to java file so
  that we can verify that these samples at least compile.

Closes #24203
2018-03-16 07:42:48 +01:00
Christoph Büscher ae912cbde4
[Docs] Fix Java Api index administration usage (#28260)
The Java API documentation for index administration currenty is wrong because
the PutMappingRequestBuilder#setSource(Object... source) an
CreateIndexRequestBuilder#addMapping(String type, Object... source) methods
delegate to methods that check that the input arguments are valid key/value
pairs. This changes the docs so the java api code examples are included from
documentation integration tests so we detect compile and runtime issues earlier.

Closes #28131
2018-03-14 22:02:06 +01:00
Jason Tedor 29a728526e Fix typo in terminate after API docs
This commit fixes a minor typo in the terminate after Java API docs.

Relates #29065
2018-03-14 13:04:07 -04:00
Martijn van Groningen ab2d74c001
Removed outdated docs about shading Elasticsearch 2018-03-14 17:38:58 +01:00
Martijn van Groningen 34a264c375
added docs for `wrapper` query.
Closes #11591
2018-03-14 11:51:22 +01:00
olcbean 472acf7833 [DOCS] fix put_mapping snippet (#28814)
Add a java snippet to be run in an integration test
in order to guarantee that the snippet is correct

Closes #28778
2018-03-01 10:59:52 +01:00
David Pilato a1c40b05cb
Fix GeoDistance query example (#28355) 2018-01-24 12:28:51 +01:00
Christoph Büscher 8a58df46f3 Revert "[Docs] Fix Java Api index administration usage (#28133)"
This reverts commit 67c1f1c856.
2018-01-16 17:31:11 +01:00
Christoph Büscher 409b3d2ebd Revert "[Docs] Fix base directory to include for put_mapping.asciidoc"
This reverts commit 4f5be7db3c.
2018-01-16 17:30:55 +01:00
Christoph Büscher 4f5be7db3c [Docs] Fix base directory to include for put_mapping.asciidoc 2018-01-16 15:19:47 +01:00
Christoph Büscher 67c1f1c856
[Docs] Fix Java Api index administration usage (#28133)
The Java API documentation for index administration currenty is wrong because
the PutMappingRequestBuilder#setSource(Object... source) and
CreateIndexRequestBuilder#addMapping(String type, Object... source) methods
delegate to methods that check that the input arguments are valid key/value
pairs:

https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-admin-indices.html

This changes the docs so the java api code examples are included from
documentation integration tests so we detect compile and runtime issues earlier.

Closes #28131
2018-01-16 12:05:03 +01:00
Combalgorythm 3c032f84f4 Modifies the JavaAPI docs related to AggregationBuilder
1."AggregationBuilder" replaces "AggregatorBuilder" in docs/java-api/aggregations/bucket/iprange-aggregation.asciidoc
2."GeoBoundsAggregationBuilder" replaces "GeoBoundsBuilder" in docs/java-api/aggregations/metrics/geobounds-aggregation.asciidoc

Closes #28143
2018-01-11 12:59:30 +01:00
Martijn van Groningen 4182e9e3bb
docs: Replaces indexed script java api docs with stored script api docs
Closes #28144
2018-01-10 18:03:14 +01:00
Simon Willnauer 481d98b8d5
Remove `operationThreaded` from Java API (#27836)
This option is completely unused. Some places set it but we never read
the value neither respect it.
2017-12-15 15:20:55 +01:00
Catalin Ursachi b44ae25c27 Updated "string" datatype in docs & tests to "text" (#27629) 2017-12-04 11:51:00 +01:00
Luca Cavanna 3e8ca38fca
Deprecate the transport client in favour of the high-level REST client (#27085) 2017-12-01 12:24:16 +01:00
Christoph Büscher 0d11b9fe34
[Docs] Unify spelling of Elasticsearch (#27567)
Removes occurences of "elasticsearch" or "ElasticSearch" in favour of
"Elasticsearch" where appropriate.
2017-11-29 09:44:25 +01:00
Jason Tedor 3176ba418e Remove deploying in JBoss documentation
This documentation is not maintained and we do not intend to maintain
it. Thus, this commit removes this documentation.

Relates #26902
2017-10-05 15:41:32 -04:00
Jason Tedor 2e63a13c0a Upgrade to Log4j 2.9.1
This commit upgrades the Log4j dependency, picking up a fix for an issue
with handling stack traces on JDK 9.

Relates #26750
2017-09-22 11:57:06 -04:00
jiangzhuolin a6d57f50f6 [Docs] Update method setSource(byte[] source) (#26561)
The method setSource(byte[]) from the type IndexRequestBuilder is deprecated,
use the method setSource(byte[] source, XContentType xContentType).
2017-09-11 10:20:20 +02:00
Jason Tedor 697bc266ce Upgrade to Log4j 2.9.0
This commit upgrades the Log4j dependency from version 2.8.2 to version
2.9.0.

Relates #26450
2017-08-31 09:54:35 -04:00
hanbj 62021147ea Update reference from DateHistogram to Histogram (#26169)
DateHistogram was renamed, but java api docs were not updated. This commit updates a reference to DateHistogram to the new general Histogram class.
2017-08-14 11:52:23 -07:00
hanbj 9a908995a8 Fix incorrect class name in deleteByQuery docs (#26151)
Class was renamed but docs weren't updated.
2017-08-11 14:55:51 -04:00
David Pilato 9c372e533e Fix wrong header level
Relates to #26113.
2017-08-10 17:19:01 +02:00
David Pilato 3fc27b0e90 Document how to import Lucene Snapshot libs when elasticsearch clients (#26113)
When using the High Level Rest Client 6.0.0-beta1, we are missing some transitive dependencies for Lucene as Lucene 7 has not been released yet. See the following `pom.xml`:

```xml
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-client</artifactId>
            <version>6.0.0-beta1</version>
        </dependency>
        <dependency>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>elasticsearch-rest-high-level-client</artifactId>
            <version>6.0.0-beta1</version>
        </dependency>
```

It gives:

```
[ERROR] Failed to execute goal on project fscrawler: Could not resolve dependencies for project fr.pilato.elasticsearch.crawler:fscrawler:jar:2.4-SNAPSHOT: The following artifacts could not be resolved: org.apache.lucene:lucene-analyzers-common:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-backward-codecs:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-grouping:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-highlighter:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-join:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-memory:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-misc:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-queries:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-queryparser:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-sandbox:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-spatial:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-spatial-extras:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-spatial3d:jar:7.0.0-snapshot-00142c9, org.apache.lucene:lucene-suggest:jar:7.0.0-snapshot-00142c9: Failure to find org.apache.lucene:lucene-analyzers-common:jar:7.0.0-snapshot-00142c9 in https://artifacts.elastic.co/maven/ was cached in the local repository, resolution will not be reattempted until the update interval of elastic-download-service has elapsed or updates are forced -
```

We need to add some temporary documentation on how to add the missing repository to a gradle or maven project:

```xml
        <repository>
            <id>elastic-lucene-snapshots</id>
            <name>Elastic Lucene Snapshots</name>
            <url>http://s3.amazonaws.com/download.elasticsearch.org/lucenesnapshots/00142c9</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>false</enabled></snapshots>
        </repository>
```

This also applies to the transport client.

Closes #26106.
2017-08-10 14:54:07 +02:00
Tanguy Leroux 9c8d3d3569 [Docs] Add migration notes for the high-level rest client (#25911) 2017-08-01 10:38:56 +02:00
Luca Cavanna b9ce222a6e [DOCS] add links to javadocs to clients docs (#25745)
We publish javadocs to artifacts.elastic.co (and snapshots.elastic.co) for a while. This commit adds the link to them to the transport client, low level REST client, sniffer and high level REST client pages.

Closes #23761
2017-07-31 15:41:21 +02:00
Martijn van Groningen 02fad9ac8c
docs: updated java client api to take this into account too to take into account the p/c queries are in parent-join module
Closes #25624
2017-07-13 11:24:22 +02:00
Jason Tedor 1708f1773b Mark Log4j API dependency as non-optional
The Log4j dependency is separated into two artifacts, the API and the
core implementation. This is to enable replacing Log4j on the backend
through the SLF4J bridge with another logging implementation. For this
reason, the dependencies are marked as optional. This causes confusion
amongst users as to use the bridge, the API should be non-optional since
it is needed for the bridge to function correctly. While they could pull
it into their application directly, it would be clearer if we simply
marked this depdendency as non-optional. Note that this does not mean
that users have to use Log4j for logging in their application, so we are
not marking core as required, it only clarifies what they need to be
able to plug in a different logging implementation.

Relates #25136
2017-06-08 16:09:34 -04:00
Jim Ferenczi 279a18a527 Add parent-join module (#24638)
* Add parent-join module

This change adds a new module named `parent-join`.
The goal of this module is to provide a replacement for the `_parent` field but as a first step this change only moves the `has_child`, `has_parent` queries and the `children` aggregation to this module.
These queries and aggregations are no longer in core but they are deployed by default as a module.

Relates #20257
2017-05-12 15:58:06 +02:00
qwerty4030 e7d352b489 Compound order for histogram aggregations. (#22343)
This commit adds support for histogram and date_histogram agg compound order by refactoring and reusing terms agg order code. The major change is that the Terms.Order and Histogram.Order classes have been replaced/refactored into a new class BucketOrder. This is a breaking change for the Java Transport API. For backward compatibility with previous ES versions the (date)histogram compound order will use the first order. Also the _term and _time aggregation order keys have been deprecated; replaced by _key.

Relates to #20003: now that all these aggregations use the same order code, it should be easier to move validation to parse time (as a follow up PR).

Relates to #14771: histogram and date_histogram aggregation order will now be validated at reduce time.

Closes #23613: if a single BucketOrder that is not a tie-breaker is added with the Java Transport API, it will be converted into a CompoundOrder with a tie-breaker.
2017-05-11 18:06:26 +01:00
Nik Everett 732741dd8d Build that java api docs from a test (#24354)
We've had `QueryDSLDocumentationTests` for a while but it had a very
hopeful comment at the top about how we want to make sure that the
example in the query-dsl docs match up with the test but we never
had anything that made *sure* that they did. This changes that!

Now the examples from the query-dsl docs are all built from the
`QueryDSLDocumentationTests`. All except for the percolator example
because that is hard to do as it stands now.

To make this easier this change moves `QueryDSLDocumentationTests`
from core and into the high level rest client. This is useful for
two reasons:
1. We expect the high level rest client to be able to use the builders.
2. The code that builds that docs doesn't check out all of
Elasticsearch. It only checks out certain directories. Since we're
already including snippets from that directory we don't have to
make any changes to that process.

Closes #24320
2017-05-02 13:00:56 -04:00
makeyang 0e322a7e0b Update TransportClient java documentation (#24205)
We are using now in master `TransportAddress` instead of `InetSocketTransportAddress`.
2017-04-20 10:35:35 +02:00
BUPTAnderson a973197503 docs: fix search info in transport API docs (#22045)
fix some error!
2017-04-17 22:19:47 -04:00
Jason Tedor 61c5976aee Upgrade to Log4j 2.8.2
This commit upgrades the Log4j dependencies from version 2.7 to version
2.8.2. This release includes a fix for a case where Log4j could lose
exceptions in the presence of a security manager.

Relates #23995
2017-04-09 07:19:16 -04:00
Nik Everett 471af48170 Docs: fix response object name
In #22810 I renamed a response object used by reindex and friends
but didn't update the java-api documentation that uses it. This
makes that update.
2017-04-05 16:03:49 -04:00
Minwoo Kim 6b46334d31 Docs: fix a typo in transport client's put-mapping.asciidoc (#23607)
It was talking about the wrong type.
2017-03-20 15:05:40 -04:00
Jason Tedor b9ac69cbd8 Unmark reindex as experimental
The reindex API is mature now, and we will work to maintain backwards
compatibility in accordance with our backwards compatibility
policy. This commit unmarks the reindex API as experimental.

Relates #23621
2017-03-16 22:02:15 -04:00
David Pilato e3b1c95623 Fix settingsBuilder() with builder() 2017-03-09 02:52:19 -08:00
Clinton Gormley c1be26f2e1 Centralised doc versions in docs/Versions.asciidoc 2017-02-04 11:16:19 +01:00
Rob Moore 40e1c136de Update search.asciidoc (#22865) 2017-02-01 09:24:19 +01:00
David Pilato 4fba1c562f Merge pull request #22235 from dadoonet/doc/dbq-java-api
Add documentation for Delete By Query Java API
2016-12-23 16:04:19 +01:00
Rui Hu 80f8dfe852 Fixed document mistake and fit for 5.1.1 API 2016-12-21 08:18:16 -05:00
Clinton Gormley 9b22ec1c6a Add ID for percolate query to Java API docs 2016-12-21 10:54:27 +01:00
Chris Earle 61e1678e66 [DOCS] Update Percolate Java example
The percolator's Java example was note quite right. This updates it to use working code.
2016-12-20 19:07:36 -05:00
David Pilato 72ee65f914 Add documentation for Delete By Query Java API
Closes #22114
2016-12-16 18:11:55 +01:00
David Pilato e32c7f1d72 Explain how to use bulk processor in a test context
When using a bulk processor in test, you might write something like:

```java
BulkProcessor bulkProcessor = BulkProcessor.builder(client, new BulkProcessor.Listener() {
    @Override public void beforeBulk(long executionId, BulkRequest request) {}
    @Override public void afterBulk(long executionId, BulkRequest request, BulkResponse response) {}
    @Override public void afterBulk(long executionId, BulkRequest request, Throwable failure) {}
})
        .setBulkActions(10000)
        .setFlushInterval(TimeValue.timeValueSeconds(10))
        .build();

for (int i = 0; i < 10000; i++) {
    bulkProcessor.add(new IndexRequest("foo", "bar", "doc_" + i)
            .source(jsonBuilder().startObject().field("foo", "bar").endObject()
    ));
}

bulkProcessor.flush();
client.admin().indices().prepareRefresh("foo").get();
SearchResponse response = client.prepareSearch("foo").get();
// response does not contain any hit
```

The problem is that by default bulkProcessor defines the number of concurrent requests to 1 which is using behind the scene an Async BulkRequestHandler.
When you call `flush()` in a test, you expect it to flush all the content of the bulk so you can search for your docs.
But because of the async handling, there is a great chance that none of the documents has been indexed yet when you call the `refresh` method.

We should advice in our Java guide to explicitly set concurrent requests to `0` so users will use behind the scene the Sync BulkRequestHandler.

```java
BulkProcessor bulkProcessor = BulkProcessor.builder(client, new BulkProcessor.Listener() {
    @Override public void beforeBulk(long executionId, BulkRequest request) {}
    @Override public void afterBulk(long executionId, BulkRequest request, BulkResponse response) {}
    @Override public void afterBulk(long executionId, BulkRequest request, Throwable failure) {}
})
        .setBulkActions(5000)
        .setFlushInterval(TimeValue.timeValueSeconds(10))
        .setConcurrentRequests(0)
        .build();
```

Closes #22158.
2016-12-16 16:45:56 +01:00