Commit Graph

11957 Commits

Author SHA1 Message Date
Simon Willnauer 5d4db0edde Remove accidential modification 2015-05-15 17:03:45 +02:00
Simon Willnauer 9f81ae4845 Merge branch 'master' into feature/translog_checkpoints
Conflicts:
	src/main/java/org/elasticsearch/action/termvectors/TermVectorsFields.java
2015-05-15 17:01:23 +02:00
Michael McCandless a42d92df21 Small fixes:
- rename one method
  - move "generation == null" check under existing "if (createNew == false)"
  - fix typo/whitespace
  - add a TODO
2015-05-15 10:47:17 -04:00
Adrien Grand c5e74a8d72 Merge pull request #11141 from jpountz/fix/fieldnameanalyzer_leniency
Mappings: Make FieldNameAnalyzer less lenient.
2015-05-15 16:41:44 +02:00
Adrien Grand bf599d68dd Merge pull request #11042 from jpountz/feature/aggs_missing
Aggs: Make it possible to configure missing values.
2015-05-15 16:33:29 +02:00
Adrien Grand 32e23b9100 Aggs: Make it possible to configure missing values.
Most aggregations (terms, histogram, stats, percentiles, geohash-grid) now
support a new `missing` option which defines the value to consider when a
field does not have a value. This can be handy if you eg. want a terms
aggregation to handle the same way documents that have "N/A" or no value
for a `tag` field.

This works in a very similar way to the `missing` option on the `sort`
element.

One known issue is that this option sometimes cannot make the right decision
in the unmapped case: it needs to replace all values with the `missing` value
but might not know what kind of values source should be produced (numerics,
strings, geo points?). For this reason, we might want to add an `unmapped_type`
option in the future like we did for sorting.

Related to #5324
2015-05-15 16:26:58 +02:00
Adrien Grand 3e215e720a Merge pull request #11144 from jpountz/fix/remove_hppc_esoteric_dep
Internal: remove dependency on hppc:esoteric.
2015-05-15 16:25:51 +02:00
Martijn van Groningen 719252a138 Merge pull request #11183 from martijnvg/parent-child/remove_id_cache_from_stats_and_clear_cache_apis
Removed `id_cache` from stats and cat apis.
2015-05-15 14:39:35 +02:00
Martijn van Groningen ece18f162e Removed `id_cache` from stats and cat apis.
Also removed the `id_cache` option from the clear cache api.

Closes #5269
2015-05-15 14:06:18 +02:00
Jun Ohtani 3a1a4d3e89 Analysis: Add multi-valued text support
Add support array text as a multi-valued for AnalyzeRequestBuilder
Add support array text as a multi-valued for Analyze REST API
Add docs

Closes #3023
2015-05-15 20:01:10 +09:00
Adrien Grand 66921ffa50 Remove unused docidset-related code. 2015-05-15 12:33:19 +02:00
Alexander Reelsen f05808d59e HttpServer: Support relative plugin paths in configuration
When specifying relative paths on startup, handling plugin
paths failed due to recently added security fix. This fix
ensures normalization of the plugin path as well.

In addition a new matcher has been added to easily check for a
status code of an HTTP response likes this

assertThat(response, hasStatus(OK));

Closes #10958
2015-05-15 08:40:40 +02:00
Simon Willnauer 50c771be29 [ENGINE] Signal when a new index is created also in Translog creation code
Clarify when a new tranlog should be created by passing the
same create flag to the IndexWriter as well as to the Translog creation
2015-05-15 08:31:56 +02:00
Nicholas Canzoneri 8831ae6e5c Add index name to log statements when settings update fails
When an index setting is invalid and fails to be set, a WARN statement
is logged but it doesn't contain the index name, making tracking down
and fixing the problem more difficult. This commit adds the index name
to the log statement.
2015-05-14 18:44:48 -04:00
Ryan Ernst 91aeea9c66 Make highlighter check source enabled again instead of source complete...for now. 2015-05-14 15:21:07 -07:00
Areek Zillur ac4942b5a7 [TEST] improve Phrase Collate filter test 2015-05-14 18:16:03 -04:00
Lee Hinman 179dad69b6 [DOCS] Add DNS SRV discovery plugin 2015-05-14 16:02:59 -06:00
Ryan Ernst 7cacfa0769 Change includes/excludes back to null based for now, since it
complicates serialization and causes a number of test failures.
2015-05-14 14:58:06 -07:00
Ryan Ernst a6b0f0a8c1 Merge pull request #11171 from rjernst/fix/11116
Mappings: Add back support for enabled/includes/excludes in _source
2015-05-14 14:41:47 -07:00
Ryan Ernst 0e14c6d256 Fix includes/excludes to be handled on merge conflict checking when they
are null
2015-05-14 14:36:26 -07:00
Areek Zillur 7efc43db25 Re-structure collate option in PhraseSuggester to only collate on local shard.
Previously, collate feature would be executed on all shards of an index using the client,
this leads to a deadlock when concurrent collate requests are run from the _search API,
due to the fact that both the external request and internal collate requests use the
same search threadpool.

As phrase suggestions are generated from the terms of the local shard, in most cases the
generated suggestion, which does not yield a hit for the collate query on the local shard
would not yield a hit for collate query on non-local shards.

Instead of using the client for collating suggestions, collate query is executed against
the ContextIndexSearcher. This PR removes the ability to specify a preference for a collate
query, as the collate query is only run on the local shard.

closes #9377
2015-05-14 17:21:53 -04:00
Simon Willnauer 08d7638ed1 apply review comments 2015-05-14 22:57:53 +02:00
Areek Zillur af6b69e791 Ensure empty completion entries are never indexed
closes #10987
2015-05-14 16:48:49 -04:00
Ryan Ernst d31ce43452 Mappings: Add back support for enabled/includes/excludes in _source
This adds back the ability to disable _source, as well as set includes
and excludes. However, it also restricts these settings to not be
updateable. enabled was actually already not modifiable, but no
conflict was previously given if an attempt was made to change it.

This also adds a check that can be made on the source mapper to
know if the the source is "complete" and can be used for
purposes other than returning in search or get requests. There is
one example use here in highlighting, but more need to be added
in a follow up issue (eg in the update API).

closes #11116
2015-05-14 13:04:39 -07:00
Jack Conradson df59288b72 Fixed a broken import in MultiValueMode. 2015-05-14 09:53:26 -07:00
Jack Conradson a5c0ac0d67 Scripting: Add Multi-Valued Field Methods to Expressions
Add methods to operate on multi-valued fields in the expressions language.
Note that users will still not be able to access individual values
within a multi-valued field.

The following methods will be included:

* min
* max
* avg
* median
* count
* sum

Additionally, changes have been made to MultiValueMode to support the
new median method.

closes #11105
2015-05-14 08:27:24 -07:00
Robert Muir 1d3a8ad36a Merge pull request #11163 from rmuir/jna_nosys
Use our provided JNA library, versus one installed on the system
2015-05-14 09:03:05 -04:00
Robert Muir 30cdd4c03b Use our provided JNA library, versus one installed on the system
which might be older and not work.
2015-05-14 00:09:44 -04:00
Robert Muir 3ee9ae6f9c Merge pull request #11152 from rmuir/party_time
Add test group for third-party tests
2015-05-13 16:11:25 -04:00
Simon Willnauer 91cfba3485 move reading opSize into the catch block to transform EOF into TruncatedTranslogException 2015-05-13 21:12:54 +02:00
Robert Muir 3dd706f1e6 Add these two props for consistency, so we aren't confused
when we deduplicate with elasticsearch-parent
2015-05-13 14:56:29 -04:00
Simon Willnauer 19155d8fd8 Simplify new translog creation - pending files are not needed anymore 2015-05-13 20:52:59 +02:00
Robert Muir c949ce00e8 Add test group for third-party tests 2015-05-13 14:34:53 -04:00
Simon Willnauer 96df7ba7eb Applied review comments from @mikemccand
- Renamed TranslogSnapshot to MultiSnapshot
 - moved legacy logic for trucation into LegacyTranslogReaderBase
 - made several methods private and pkg private where applicable
 - renamed arguments for consistency
2015-05-13 20:32:25 +02:00
Robert Muir 33fd25083e Merge pull request #11134 from rmuir/tests_config
Add tests.config support to BootstrapForTesting
2015-05-13 11:35:16 -04:00
Adrien Grand b64e54c424 Merge pull request #11137 from jpountz/enhancement/geo_queries
Query DSL: Make geo filters queries.
2015-05-13 17:27:15 +02:00
Simon Willnauer 869baeea0c Don't throw an exception if repositories are unregister with match all
Today we barf if repositories are unregistered with a `*` pattern. This
happens on almost every test and adds weird log messages. I dont' think
we should barf in that case.

Closes #11113
2015-05-13 17:01:04 +02:00
Simon Willnauer 6a43fe348d Fail recovery if retry recovery if resetRecovery fails
This might fail if the shard is closed for instance. This will leak
a shard lock causing the shard being locked on this node forever.
2015-05-13 16:47:18 +02:00
javanna add18a5c99 Java api: remove duplicated buildAsBytes and corresponding toString methods
We have some builders, specifically query builders, `SearchSourceBuilder`, `QuerySourceBuilder` and `SuggestBuilder`, that implement `ToXContent` and also allow to build their content as bytes by simply creating a `BytesReference` that holds their json (or yaml etc.) content (`buildAsBytes` methods). They can also print out their content through `toString`. Made sure that those common methods are in one single place and reused where needed.

Also, merged `QueryBuilder` and `BaseQueryBuilder` and made `QueryBuilder` an abstract class instead of an interface.

Closes #11063
2015-05-13 16:14:16 +02:00
javanna d2765a2e26 Java api: add missing rewrite parameter to FuzzyQueryBuilder
We parse the rewrite field in FuzzyQueryParser but we don't allow to set it via FuzzyQueryBuilder for our java api users. Added missing field and setter.

Closes #11130
Closes #11139
2015-05-13 15:46:57 +02:00
Adrien Grand 5c9c4776cd Internal: remove dependency on hppc:esoteric.
The esoteric classifier contains in particular maps that take bytes or doubles
as keys. In the byte case, we can just use integer, and in the double case we
can use their long bits instead.
2015-05-13 14:13:10 +02:00
Dawid Weiss 491b00c4ec Updating to HPPC-0.7.1
Close #11035
2015-05-13 13:53:14 +02:00
Simon Willnauer 43ff544117 Add translog checkpoints to prevent translog corruption
Today we are almost intentionally corrupt the translog if we loose
a node due to powerloss or similary disasters. In the translog reading
code we simply read until we hit an EOF exception ignoring the rest of the
translog file once hit. There is no information stored how many records
we are expecting or what the last written offset was.

This commit restructures the translog to add checkpoints that are written
with every sync operation recording the number of synced operations as well
as the last synced offset. These checkpoints are also used to identify the actual
transaction log file to open instead of relying on directory traversal.

This change adds a significant amount of additional checks and pickyness to the translog
code. For instance is the translog now associated with a specific engine via a UUID that is
written to each translog file as part of it's header. If an engine opens a translog file it
was not associated with the operation will fail.

Closes to #10933
Relates to #11011
2015-05-13 12:40:35 +02:00
Adrien Grand 472cc0af08 Merge pull request #11142 from jpountz/feature/bool_filter
Query DSL: Add `filter` clauses to `bool` queries.
2015-05-13 12:25:32 +02:00
Adrien Grand 630757906a Query DSL: Add `filter` clauses to `bool` queries.
These clauses filter the document space without affecting scoring and map to
Lucene's BooleanClause.Occur.FILTER. The `filtered` query is now deprecated and

```json
{
  "filtered": {
    "query": { //query },
    "filter": { //filter }
  }
}
```
should be replaced with
```json
{
  "bool": {
    "must": { //query },
    "filter": { //filter }
  }
}
```
2015-05-13 12:04:56 +02:00
Shay Banon ba20d4b6ba [TEST] fix unintended relocation 2015-05-13 11:18:28 +02:00
Adrien Grand 36884807b3 Merge pull request #11120 from jpountz/fix/bool_parsing
Query DSL: Fix `bool` parsing.
2015-05-13 11:09:12 +02:00
Adrien Grand 11db3170cd Query DSL: Fix `bool` parsing.
In #10985 I introduced a bug that should clauses are parsed as filters while
must_not clauses should be parsed as filters.
2015-05-13 11:08:36 +02:00
Adrien Grand 44e9b75296 Mappings: Make FieldNameAnalyzer less lenient.
In case FieldNameAnalyzer does not find an explicit analyzer for a given
field name, it returns the default analyzer. This behaviour can hide bugs
where the analyzer fails to be propagated to FieldNameAnalyzer or an
analyzer is requested for a field which is not mapped.
2015-05-13 11:01:38 +02:00
Simon Willnauer 6046ecbab3 Prevent PercolateResponse from serializing negative VLong
We are using a a VLong to serialize the PercolateResponse#tookInMillis. This
can due to several `System.currentTimeMillis()` implemenation details be negative.
We should prevent the negavite value for being serialized as a VLong and make sure
we use a valid value for this in the first place

Closes #11138
2015-05-13 10:22:08 +02:00