Commit Graph

10148 Commits

Author SHA1 Message Date
Alban Perillat-Merceroz 54466938da Fix error in documentation
Indexation does not fail if no timestamp provided when there is a default value defined in mapping.
2014-11-23 14:02:51 +01:00
dw bb81055c33 Docs: Remove reference to imaginary "no_docs_query"
No reference to it in the source code except this file.

Closes #8566
2014-11-23 13:56:33 +01:00
Mariam Hakobyan 4a1ab6543c Docs: Added new elasticsearch-river-kafka plugin to the documentation (uses latest version of Kafka, EL Bulk API, and supports concurrent requests)
Closes #8518
2014-11-23 12:28:45 +01:00
Simon Willnauer b6b3382a8b [STORE] Use Lucene checksums if segment version is >= 4.9.0
We started to use the lucene CRC32 checksums instead of the legacy Adler32
in `v1.3.0` which was the first version using lucene `4.9.0`. We can safely
assume that if the segment was written with this version that checksums
from lucene can be used even if the legacy checksum claims that it has a Adler32
for a given file / segment.

Closes #8587

Conflicts:
	src/main/java/org/elasticsearch/index/store/Store.java
	src/test/java/org/elasticsearch/index/store/StoreTest.java
2014-11-21 22:35:21 +01:00
ananich 95a396159c Added utility method to CountRequestBuilder
Allows to add a query to CountRequestBuilder as a XContentBuilder.

Closes #8594
2014-11-21 21:04:01 +01:00
Simon Willnauer 1c00790213 [TEST] all tests should extend ElasticsearchTestCase 2014-11-21 20:27:52 +01:00
Andreas Kohn 3205dce549 Fix a typo in a javadoc comment in MapperService.
Close #8575
2014-11-21 19:28:34 +01:00
Damien Alexandre 80295458ad Fix wrong error messages in MultiMatchQueryParser.
Also fix a typo in the comment

Close #8597
2014-11-21 19:28:34 +01:00
Ryan Ernst 40598a5692 Fix test failures caused by #8556 2014-11-21 10:22:13 -08:00
Ryan Ernst 4a3afcc0d3 Fix compile error from bad merge in #8556 2014-11-21 09:33:36 -08:00
Ryan Ernst fae9dcaed7 DateMath: Fix semantics of rounding with inclusive/exclusive ranges.
Date math rounding currently works by rounding the date up or down based
on the scope of the rounding.  For example, if you have the date
`2009-12-24||/d` it will round down to the inclusive lower end
`2009-12-24T00:00:00.000` and round up to the non-inclusive date
`2009-12-25T00:00:00.000`.

The range endpoint semantics work as follows:
* `gt` - round D down, and use > that value
* `gte` - round D down, and use >= that value
* `lt` - round D down, and use <
* `lte` - round D up, and use <=

There are 2 problems with these semantics:
* `lte` ends up including the upper value, which should be non-inclusive
* `gt` only excludes the beginning of the date, not the entire rounding scope

This change makes the range endpoint semantics symmetrical.  First, it
changes the parser to round up and down using the first (same as before)
and last (1 ms less than before) values of the rounding scope.  This
makes both rounded endpoints inclusive. The range endpoint semantics
are then as follows:
* `gt` - round D up, and use > that value
* `gte` - round D down, and use >= that value
* `lt` - round D down, and use < that value
* `lte` - round D up, and use <= that value

closes #8424
closes #8556
2014-11-21 09:28:30 -08:00
Alex Ksikes 1959275622 Term Vectors: More consistent naming for term vector[s]
We speak of the term vectors of a document, where each field has an associated
stored term vector. Since by default we are requesting all the term vectors of
a document, the HTTP request endpoint should rather be called `_termvectors`
instead of `_termvector`. The usage of `_termvector` is now deprecated, as
well as the transport client call to termVector and prepareTermVector.

Closes #8484
2014-11-21 14:06:44 +01:00
Simon Willnauer a6e6c4efc4 [CORE] Ensure shards are deleted under lock on close
Today there is a race condition between the actual deletion of
the shard and the release of the lock in the store. This race can cause
rare imports of dangeling indices if the cluster state update loop
tires to import the dangeling index in that particular windonw. This commit
adds more safety to the import of dangeling indices and removes the race
condition by holding on to the lock on store closing while the listener
is notified.
2014-11-21 12:20:58 +01:00
Adrien Grand abc0bc4c7f Aggregations: Fix geohash grid doc counts computation on multi-valued fields.
Close #8512
2014-11-21 11:02:04 +01:00
Thomas Cucchietti 98641ff39f Update DiskThresholdDecider javadoc
Since v1.3.0, and issue #6201, the default values in code and documentation have been updated to 85% and 90% for low and high watermarks. However, the related javadoc still contains the initial values : this commit fix this.
2014-11-21 10:24:24 +01:00
Robert Muir 9ef69f9f36 Disable bloom filters.
make the "es090" postings format read-only, just to support old segments. There is a test version that subclasses it with write-capability for testing.

Closes #8571
2014-11-20 21:03:23 -05:00
Simon Willnauer 3e1b7c7a34 [BLOOM] Fix Bloom filter ram usage calculation
BloomFilter actually returned the size of the bitset as the
size in bytes so off by factor 8 plus a constant :)

Closes #8564
2014-11-20 22:45:28 +01:00
Simon Willnauer afa62e90d9 [CORE] Free pending search contexts if index is closed
Today we hold on to search context reference if they are not cleaned
up for a while until a reaper thread trashes them if they timed out.
This commit removes all pending contexts once the index is closed to release
resources and filehandles immediatly once the index is closed.
2014-11-20 16:13:35 +01:00
Simon Willnauer d5d5dece56 [INDEX] Add before/after indexDeleted callbacks to IndicesLifecycle
In order to implement #8551 correctly without causing problems of relocating
shards we need to be informed if an index is actually deleted. This commit adds
more callbacks to the listener and makes deleteIndex a dedicated method on IndicesService
2014-11-20 15:37:35 +01:00
Simon Willnauer 26b4ebcd00 [TEST] Delete index in test to release file handles 2014-11-20 15:35:08 +01:00
Simon Willnauer 17110508ac Add missing await into an interruptable block 2014-11-20 15:35:08 +01:00
Britta Weber 06e907d99e Revert "[TEST] use logger level from test class annotation also in external nodes"
This reverts commit 4604a68bef.
2014-11-20 15:29:44 +01:00
Simon Willnauer 0fcb466555 [STORE] Remove `memory`/ `ram` store
The RAM store is discuraged for production usage anyway and
we don't test it in our randomized infrastructure. This commit
removes it for `2.0`
2014-11-20 14:47:19 +01:00
markharwood 0c94314996 Parser throws NullPointerException when Filter aggregation clause is empty.
Added Junit test that recreates the error and fixed FilterParser to default to using a MatchAllDocsFilter if the requested filter clause is left empty.
Also added fix and test for the Filters (with an "s") aggregation.

Closes #8438
2014-11-20 13:06:11 +00:00
Britta Weber 4b5592cc59 [root mappers] fix conflict when updating mapping with _all disabled
_all reports a conflict since #7377. However, it was not checked if _all
was actually configured in the updated mapping. Therefore whenever _all
was disabled a mapping could not be updated unless _all was again added to the
updated mapping.
Also, add enabled setting to mapping always whenever enabled was set explicitely.

closes #8423
closes #8426
2014-11-20 12:46:27 +01:00
Britta Weber 4604a68bef [TEST] use logger level from test class annotation also in external nodes
closes #8552
2014-11-20 12:04:08 +01:00
Adrien Grand dc3389a97a Tests: Fix test bug in Filter[s]Tests that made it throw a version conflict. 2014-11-20 11:30:49 +01:00
Adrien Grand a94fb92ac5 Aggregations: Fix geohash grid aggregation on multi-valued fields.
This aggregation creates an anonymous fielddata instance that takes geo points
and turns them into a geo hash encoded as a long. A bug was introduced in 1.4
because of a fielddata refactoring: the fielddata instance tries to populate
an array with values without first making sure that it is large enough.

Close #8507
2014-11-20 10:03:56 +01:00
Adrien Grand f30a0e846d Aggregations: Do not take deleted documents into account in aggregations filters.
Since aggregators are only called on documents that match the query, it never
gets called on deleted documents, so by specifying `null` as live docs, we very
likely remove a BitsFilteredDocIdSet layer.

Close #8540
2014-11-20 09:59:13 +01:00
Ryan Ernst cca5934e9d Tests: Pass through locale and timezone to test runner, and print in
repro command line.

The carrot runner currently randomizes both locale and timezone, but
these are not set in the maven reproduce line.  Since they aren't
even printed, we have no idea what locale/timezone the tests
actually ran with.
2014-11-19 22:01:26 -08:00
Ryan Ernst a0b7e5842d Tests: Forward port tweak to prepareBackwardsDataDir to 1.x to allow passing
settings when loading an old index.
2014-11-19 16:54:41 -08:00
Ryan Ernst 4f225007f0 Tests: Add static index based backcompat tests
This change adds tests against static indexes for previous versions
of elasticsearch. It also adds a python script to
generate the indexes.
2014-11-19 15:56:04 -08:00
Simon Willnauer 5763116dbe Revert "[TEST] Add search trace logging for debugging"
This reverts commit a7b2bdca4c.
2014-11-20 00:12:01 +01:00
Simon Willnauer 4df867fd17 Revert "[CORE] Free pending search contexts if index is closed"
This reverts commit edc48f39c5.
2014-11-20 00:10:43 +01:00
Martijn van Groningen 52b77dad8d Test: Fix malformed mapping setting, slipped in from merging a commit from 1.x 2014-11-19 23:51:21 +01:00
Martijn van Groningen 7cc2bc8a14 Core: Added query/filter wrapper that builds the actual query to be executed on the last possible moment to aid with index aliases and percolator queries using `now` date expression.
Percolator queries and index alias filters are parsed once and reused as long as they exist on a node. If they contain time based range filters with a `now` expression then the alias filters and percolator queries are going to be incorrect from the moment these are constructed (depending on the date rounding).

 If a range filter or range query is constructed as part of adding a percolator query or a index alias filter then these get wrapped in special query or filter wrappers that defer the resolution of now at last possible moment as apposed during parse time. In the case of the range filter a special Resolvable Filter makes sure that `now` is resolved when the DocIdSet is pulled and in the case of the range query `now` is resolved at query rewrite time. Both occur at the time the range filter or query is used as apposed when the query or filter is constructed during parse time.

Closes #8474
Closes #8534
2014-11-19 23:21:39 +01:00
Simon Willnauer a7b2bdca4c [TEST] Add search trace logging for debugging 2014-11-19 23:13:45 +01:00
Simon Willnauer 043f18d5ff [RECOVERY] Allow to cancle recovery sources when shards are closed
Today recovery sources are not cancled if a shard is closed. The recovery target
is already cancled when shards are closed but we should also cleanup and cancel
the sources side since it holds on to shard locks / references until it's closed.
2014-11-19 22:50:30 +01:00
Simon Willnauer edc48f39c5 [CORE] Free pending search contexts if index is closed
Today we hold on to search context reference if they are not cleaned
up for a while until a reaper thread trashes them if they timed out.
This commit removes all pending contexts once the index is closed to release
resources and filehandles immediatly once the index is closed.
2014-11-19 21:44:51 +01:00
Boaz Leskes fb81a3203b Internal: IndexService - synchronize close to prevent race condition with shard creation
During node shutdown we have a race condition between processing cluster state updates (creating shards) and closing down the index service. This may cause shards to leak and not be closed properly.

This commit removes the concurrency in shard closing as InternalIndexService.removeShard has been synchronized for a long time now.

On the other hand, the commit restores the parallel shutdown of indices lost in 7e1d8a6ca3

Closes #8557
2014-11-19 21:31:10 +01:00
Philipp Bogensberger 69ac838259 Fix: If dangling_timeout was set to 0 and auto_import_dangled
was set to yes, dangling indices were deleted by mistake,
because a RemoveDanglingIndices runnable was added
to every dangling indices, without considering the auto_import_dangled
setting.
2014-11-19 15:08:57 +00:00
David Pilato cbced948c4 Fix example in logging daily rotate configuration
PR #8464 come with a bug in the example provided.

First, the current log file is not compressed so it should not end with `.gz`.
Second, conversion pattern was removing all the log content but was printing only the log date.
Then, the current log filename was hardcoded to `elasticsearch` instead of the cluster name.
2014-11-19 15:58:53 +01:00
Nicholas Knize c297ca1668 [GEO] Add LinearRing and LineString validity checks as defined by http://geojson.org/geojson-spec.html to ensure valid polygons are specified at parse time.
Closes #8433
2014-11-19 08:23:50 -06:00
Simon Willnauer 923ddcce42 add more debug logging if recovery thread got iterrupted 2014-11-19 15:14:52 +01:00
javanna 06fafa3ed9 [DOCS] document that we support loading multiple logging conf files 2014-11-19 11:34:57 +01:00
javanna ecc56a57f5 [TEST] move LoggingConfigurationTests to common.logging.log4j
Make also LogConfigurator#ALLOWED_SUFFIXES package private so that it can be used in LoggingConfigurationTests, now that it's in the same package as the class that it tests.
Add few randomized aspects to LoggingConfigurationTests.
2014-11-19 11:34:35 +01:00
Mathias Fussenegger 2dcb1f503d Logging: restrict files loaded as logging configuration based on their suffix
Make sure that files such as logging.yml.rpmnew or logging.yml.bak are not loaded as logging configuration.

Only files that start with the "logging." prefix and end with ".yaml", ".yml", ".json" and ".properties" suffix get loaded.

Closes #7457
2014-11-19 11:34:03 +01:00
Igor Motov 314da4ec9e Test: don't enable unnecessary http transport in restoreIndexWithShardsMissingInLocalGateway test 2014-11-18 21:08:24 -05:00
Boaz Leskes 1e16375d04 Docs: Update execution hint docs for Significant terms agg
copied over the relevant pieces from the terms agg

Closes #8532
2014-11-18 20:54:26 +01:00
Simon Willnauer 7f27664ae0 [TEST] Revert accidential massive iterations 2014-11-18 17:26:31 +01:00