Commit Graph

13711 Commits

Author SHA1 Message Date
Martijn van Groningen 1cfb6a79f1 Parent/child: refactored _parent field mapper and parent/child queries
* Cut the `has_child` and `has_parent` queries over to use Lucene's query time global ordinal join. The main benefit of this change is that parent/child queries can now efficiently execute if parent/child queries are wrapped in a bigger boolean query. If the rest of the query only hit a few documents both has_child and has_parent queries don't need to evaluate all parent or child documents any more.
* Cut the `_parent` field over to use doc values. This significantly reduces the on heap memory footprint of parent/child, because the parent id values are never loaded into memory.

Breaking changes:
* The `type` option on the `_parent` field can only point to a parent type that doesn't exist yet, so this means that an existing type/mapping can't become a parent type any longer.
* The `has_child` and `has_parent` queries can no longer be use in alias filters.

All these changes, improvements and breaks in compatibility only apply for indices created with ES version 2.0 or higher. For indices creates with ES <= 2.0 the older implementation is used.

It is highly recommended to re-index all your indices with parent and child documents to benefit from all the improvements that come with this refactoring. The easiest way to achieve this is by using the scan and bulk apis using a simple script.

Closes #6107
Closes #8134
2015-05-29 21:44:17 +02:00
Clinton Gormley bd381b86ca Release notes: Add HTML header with UTF-8 encoding 2015-05-29 21:02:38 +02:00
Colin Goodheart-Smithe a9ee78dd08 [TEST] muted ElasticsearchRestTestCase
This is because commit 35a58d874e causes the following REST tests to fail and reverting the commit causes conflicts:

update/15_script/Script
script/10_basic/Indexed script
2015-05-29 18:52:29 +01:00
Areek Zillur fb8cd53582 This commit removes the ability to use `filter` for PhraseSuggester collate.
Only `query` can be used for collation.

Internally, a collate query is executed as an exists query. So specifying a
filter does not have any benefits.
2015-05-29 12:26:08 -04:00
Colin Goodheart-Smithe 35a58d874e Scripting: Unify script and template requests across codebase
This change unifies the way scripts and templates are specified for all instances in the codebase. It builds on the Script class added previously and adds request building and parsing support as well as the ability to transfer script objects between nodes. It also adds a Template class which aims to provide the same functionality for template APIs

Closes #11091
2015-05-29 16:52:04 +01:00
Adrien Grand 0f3206e60c Merge pull request #11279 from jpountz/fix/simplify_compression
Internal: tighten up our compression framework.
2015-05-29 17:23:07 +02:00
Ryan Ernst 1f2c42fd0b Mappings: Refactor core index/query time properties into FieldType
Mappers are currently used at both index and query time for deciding
how to "use" a field.  For #8871, we need the index wide view of
mappings to have a unified set of settings for each field of a given
name within the index.

This change moves all the current settings (and methods defining
query time behavior) into subclasses of FieldType. In a future
PR, this will allow storing the field type at the index level,
instead of mappers (which can still have settings that differ
per document type).

The change is quite large (I'm sorry). I could not see a way to
migrate to this in a more piecemeal way. I did leave out cutting
over callers of the query methods to using the field type, as
that can be done in a follow up.
2015-05-29 17:07:04 +02:00
Adrien Grand b6a3952036 Internal: Use DEFLATE instead of LZF for compression.
LZF only stays for backward-compatibility reasons and can only read, not write.
DEFLATE is configured to use level=3, which is a nice trade-off between speed
and compression ratio and is the same as we use for Lucene's high compression
codec.
2015-05-29 17:01:45 +02:00
Christoph Büscher 29fbcd225b Merge pull request #11382 from cbuescher/fix/10825
Fix typed parameters in IndexRequestBuilder and CreateIndexRequestBuilder
2015-05-29 14:56:55 +02:00
Christoph Büscher c7ca64cc08 Fix typed parameters in IndexRequestBuilder and CreateIndexRequestBuilder
IndexRequestBuilder#setSource as well as CreateIndexRequestBuilder#setSettings and
CreateIndexRequestBuilder#setSouce() will not work with Map<String, String> argument
although the API looks like it should. This PR fixes the problem introducing correct
wildcard parameters and adds tests.

Closes #10825
2015-05-29 14:42:58 +02:00
Simon Willnauer 5a9694783b Consolidate shard level modules without logic into IndexShardModule
We have a lot of module classes that don't contain any actual logic,
only declarative bind actions. These classes are unnecessary and can
be consolidated into the already existings IndexShardModule
2015-05-29 14:16:34 +02:00
Britta Weber d23449ee85 [test] fix name in synced flush test 2015-05-29 13:48:37 +02:00
Spyros Kapnissis 784a26321b Query DSL: throw an exception if array passed to `term` query.
Closes #11246
Closes #11384
2015-05-29 13:40:15 +02:00
Simon Willnauer a7779d8e1d Merge pull request #11412 from s1monw/close_lock
Close lock even if we fail to obtain
2015-05-29 13:37:54 +02:00
Clinton Gormley 18c8394fbd REST spec: Renamed indices.flush.synced to indices.flush_synced 2015-05-29 12:30:43 +02:00
Adrien Grand 08ee4a87b3 Internal: tighten up our compression framework.
We have a compression framework that we use internally, mainly to compress some
xcontent bytes. However it is quite lenient: for instance it relies on the
assumption that detection of the compression format can only be called on either
some compressed xcontent bytes or some raw xcontent bytes, but nothing checks
this. By the way, we are misusing it in BinaryFieldMapper so that if someone
indexes a binary field which happens to have the same header as a LZF stream,
then at read time, we will try to decompress it.

It also simplifies the API by removing block compression (only streaming) and
some code duplication caused by some methods accepting a byte[] and other
methods a BytesReference.
2015-05-29 12:13:18 +02:00
Simon Willnauer c3c79290c6 Close lock even if we fail to obtain 2015-05-29 11:59:27 +02:00
Britta Weber a031232c48 [doc] remove reference to seal, was removed in #11336 2015-05-29 11:40:34 +02:00
Boaz Leskes 521f804c7d Mapping: add an assertion to verify consistent serialization
We recently run into two issues where mapping weren't serialized in a consistent manner (#10302 and #10318). We rely on this consistency to do a byte level checl that mappings we get from the master are indentical to the one we have locally. Mistakes here can cause endless refresh mapping loops.

This commit adds an assert that verifies this upon every update from the master.
2015-05-29 11:37:00 +02:00
Simon Willnauer e98b68a665 Prevent changing the number of replicas on a closed index
Setting the number of replicas on a closed index can leave the index
in an unopenable state since we might not be able to recover a quorum.
This commit simply prevents updating this setting on a closed index.

Closes #9566
2015-05-29 11:15:37 +02:00
Michael McCandless 6723c72716 make units required for byte size values 2015-05-29 05:04:24 -04:00
Simon Willnauer 5cd6ced7ee Close ShardFilterCache after Store is closed
The ShardFilterCache relies on the fact that it's
closed once the last reader on the shard is closed.
This is only guaranteed once the Store and all its
references are closed. This commit moves the closing
into the internal callback mechanism we use for deleting
shard data etc. to close the cache once we have all
searchers released.
2015-05-29 10:58:34 +02:00
Britta Weber 87a0c76e9c Merge remote-tracking branch 'boaz/index_seal_to_flush_sync' 2015-05-29 10:31:03 +02:00
Adrien Grand 6f002ffca8 Merge pull request #11381 from jpountz/fix/remove_unused_code
Internal: remove unused code.
2015-05-29 10:11:36 +02:00
Adrien Grand 1bf2a44044 Merge pull request #11308 from jpountz/fix/term_vs_terms_query
Search: Do not specialize TermQuery vs. TermsQuery.
2015-05-29 09:45:09 +02:00
Alexander Reelsen 5600757f3e Serialization: Remove old version checks
As the 2.x release does not need to be backwards compatible in terms of
serialization, we can remove a fair share of the serialization checks.
2015-05-29 08:28:45 +02:00
Igor Motov c695f35bca Tests: make REST upgrade test more reliable
Make sure that all shards are started to avoid flush conflicts.
2015-05-28 12:37:52 -10:00
Igor Motov 503f844a05 Tests: make randomRepoPath work with bwc tests 2015-05-28 12:37:51 -10:00
Lee Hinman 65132d5533 Merge remote-tracking branch 'dakrone/si-reading-fallback' 2015-05-28 16:31:44 -06:00
Lee Hinman 790baed755 Fall back to reading SegmentInfos from Store if reading from commit
fails

In the event that reading from the latest commit fails, we should fall
back to reading from the `Store` using the traditional
`Directory.listAll()`

Related to #11361
2015-05-28 16:29:49 -06:00
Igor Motov 6980286ba4 Core: fix upgrade response serialization 2015-05-28 09:46:46 -10:00
Igor Motov 3db9caf7a1 Tests: Increase timeout waiting for snapshot to complete in batchingShardUpdateTaskTest
When this test picks a large number of shards, the snapshot doesn't always manage to complete in 10 seconds.
2015-05-28 08:56:30 -10:00
Lee Hinman 5a73a16355 Merge branch 'pr/10896' 2015-05-28 12:32:33 -06:00
Igor Motov d955461f58 Tests: fix NPE in UpgradeTest 2015-05-28 07:25:00 -10:00
jaymode f732900111 Export hostname as environment variable for plugin manager
In #9474, we exported the hostname in the bin/elasticsearch scripts so that it
could be used as a variable in the elasticsearch.yml file but did not do the same
for plugin manager. When using the hostname variable in elasticsearch.yml and
trying to use the plugin manager, initialization will fail because the property could
not be resolved. This change will allow the hostname to be resolved in the same
manner as the service scripts.

Closes #10902
2015-05-28 13:03:30 -04:00
Igor Motov 55fc3a727b Core: refactor upgrade API to use transport and write minimum compatible version that the index was upgraded to
In #11072 we are adding a check that will prevent opening of old indices. However, this check doesn't take into consideration the fact that indices can be made compatible with the current version through upgrade API. In order to make compatibility check aware of the upgrade, the upgrade API should write a new setting `index.version.minimum_compatible` that will indicate the minimum compatible version of lucene this index is compatible with and `index.version.upgraded` that will indicate the version of elasticsearch that performed the upgrade.

Closes #11095
2015-05-28 05:23:49 -10:00
David Pilato 6024f89032 [maven] add script to generate maven submodules project
This commit adds a shell script which:

* move current elasticsearch core source in `/core`
* fetch `elasticsearch-parent` project in `/`
* fetch plugins in `/plugins`
* change `groupId` for all plugins to `org.elasticsearch.plugin` so versions won't conflict in maven central
* remove plugins/name/dev-tools dir which is not needed anymore
* remove plugins/name/.git dir
* remove plugins/name/LICENSE and plugins/name/CONTRIBUTING files
* clean `core/pom.xml` of useless settings that are inherited from parent project.
* `core/pom.xml` is adapted to change location of rest tests definition (`../`)
* change core name to `Elasticsearch Core`
* remove `plugins` dir from `.gitignore`

Plugins added:

* Analysis
  * analysis-kuromoji
  * analysis-smartcn
  * analysis-stempel
  * analysis-phonetic
  * analysis-icu

* Mapper
  * mapper-attachments

* Language
  * lang-python
  * lang-mvel
  * lang-javascript

* Cloud
  * cloud-gce
  * cloud-azure
  * cloud-aws

River plugins are ignored but might be added if we want to.

Todo:

* check and adapt our release tool. It now has to upload all submodules as well.
* adapt Jenkins jobs
2015-05-28 17:08:10 +02:00
Alexander Reelsen 38639074b4 Testing: Ensure cat API REST tests are unaffected by randomization
The wildcard cat API REST tests relied on bulk.max and bulk.min in
the thread_pool response. However due to the thread pool types being
randomized in InternalTestCluster, the min/max values were not guaranteed
to exist (the cached thread pool type is unbounded and thus does not have a
max value).

In order to prevent this, the test has been removed and now the cat
nodes test is used for wildcard testing, which always returns stats
about the heap.
2015-05-28 16:24:41 +02:00
Simon Willnauer a4c88b7233 Consolidate directory lock obtain code
The Directory#makeLock API is trappy and can easily lead to unexpected
lock release if native locks are used. see LUCENE-6507 for details.
This commit consolidates the lock lock into one place and only returns
the lock instance if we actually acquired it.
2015-05-28 16:05:11 +02:00
markharwood 283b0931ff Aggregations fix: queries with size=0 broke aggregations that require scores.
Aggregations like Sampler and TopHits that require access to scores did not work if the query has size param set to zero. The assumption was that the Lucene query scoring logic was not required in these cases.
Added a Junit test to demonstrate the issue and a fix which relies on earlier creation of Collector wrappers so that Collector.needsScores() calls work for all search operations.

Closes #11119
2015-05-28 14:45:23 +01:00
jaymode 105f4dd512 Test: filter out colons in test section names
On Windows, colons ':' are illegal in file names and since we use a Path to
check if the test is blacklisted, tests with a colon in the test section name
will fail. This change simply removes the colon from the name when matching
against the blacklist.
2015-05-28 06:39:51 -04:00
Britta Weber 91e9caabd7 [TEST] add path.home to settings 2015-05-28 11:54:56 +02:00
Britta Weber 334763acef Merge pull request #10909 from aleph-zero/issues/9706
Read configuration file with .yaml suffix
2015-05-28 11:54:05 +02:00
javanna 2f57ae9345 Internal: deduplicate field names returned by `simpleMatchToFullName` & `simpleMatchToIndexNames` in FieldMappersLookup
Relates to #10916
Closes #11377
2015-05-28 09:14:39 +02:00
Robert Muir 5390c01b1c speed up slow test 2015-05-27 20:30:02 -04:00
Robert Muir 6e9080f41a Mark test with AwaitsFix until it gets fixed 2015-05-27 20:19:51 -04:00
Robert Muir 4291e2b2f2 speed up tests 2015-05-27 20:13:41 -04:00
Robert Muir 23726ece00 tone down test 2015-05-27 19:53:49 -04:00
Zachary Tong d32a80f37b Docs: Fix misplaced images in moving_avg docs 2015-05-27 16:13:36 -04:00
jaymode 6d96bfc98b catch UnsatisfiedLinkError on JNA load
This catches UnsatifiedLinkError when attempting to load the JNA Native
class, in cases where there are error loading the native libraries that JNA
needs to function.
2015-05-27 15:26:30 -04:00