Commit Graph

1162 Commits

Author SHA1 Message Date
javanna f624e350fb Internal: remove unused method from QueryParseContext and add comments 2015-08-31 13:14:53 +02:00
javanna c41843afec Internal: call context.handleTermsLookup rather than context.indexQueryParserService().handleTermsLookup() in TermsQueryBuilder#toQuery 2015-08-31 10:42:38 +02:00
javanna dd65bd0fe8 Internal: add comments to XContentStructure
Added comments to make sure we don't forget to remove the class once the refactoring is done.
2015-08-31 10:41:38 +02:00
javanna 84b51fc237 [TEST] don't use deprecated methods in AbstractChildTestCase 2015-08-31 10:15:05 +02:00
javanna c3070062db Internal: small QueryShardContext cleanup
Added some comments about changes that we might be able to make later on in the refactoring. Also exposed handleTermsLookup in the context directly, removed unused similarityService getter and corrected simpleMatchToIndexNames call according to changes happened on master (the method variant that accept types will go away, types are ignored anyway).
2015-08-31 10:05:47 +02:00
javanna c403bdbd62 Internal: MoreLikeThisQueryParser to refer to index taken from QueryShardContext rather than QueryParseContext
The reason behind this change is that we will soon remove the index member from QueryParseContext, as parsing will be independent of the index it happens against.
2015-08-31 10:01:56 +02:00
javanna cc408ddd45 [TEST] refactor DummyQueryBuilder and corresponding parser
DummyQueryParser properly implements now fromXContent and the corresponding builder supports converting to the corresponding lucene query through toQuery method.
2015-08-31 10:00:09 +02:00
javanna 1420482f86 Simplify XContent representation of BoolQueryBuilder to always print out an array 2015-08-31 09:58:22 +02:00
javanna 2958751a2d [TEST] parse queries through QueryParseContext in BaseQueryTestCase#parseQuery
This allows us to remove the string argument from the parseQuery method and the need for removing the first few tokens from the query, as the selected parser knows only about his portion of dsl.
2015-08-31 09:55:37 +02:00
javanna 4ed198fef0 [TEST] fix compilation error in IndexShardTests 2015-08-28 10:54:14 +02:00
javanna 78d097de39 Merge branch 'master' into feature/query-refactoring
Conflicts:
	core/src/main/java/org/apache/lucene/queryparser/classic/MapperQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/AndQueryBuilder.java
	core/src/main/java/org/elasticsearch/index/query/AndQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/BoolQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/DisMaxQueryBuilder.java
	core/src/main/java/org/elasticsearch/index/query/DisMaxQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/HasChildQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/HasParentQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/MoreLikeThisQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/MultiMatchQueryBuilder.java
	core/src/main/java/org/elasticsearch/index/query/NestedQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/OrQueryBuilder.java
	core/src/main/java/org/elasticsearch/index/query/OrQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/PrefixQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/RegexpQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/SpanNearQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/SpanOrQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/TermQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/TermsQueryParser.java
	core/src/main/java/org/elasticsearch/index/query/support/InnerHitsQueryParserHelper.java
	core/src/test/java/org/elasticsearch/index/query/SimpleIndexQueryParserTests.java
2015-08-28 10:49:28 +02:00
javanna 084a6101fe [TEST] add serialization tests for QueryShardException 2015-08-28 10:13:41 +02:00
javanna 6307738406 Internal: clean up named writeable registry handling in netty transport classes
There are some leftovers around usage of NamedWriteableRegistry in our branch compared to master, just because the registry was added first here, then backported to master, and something didn't go completely right during the final merge.
2015-08-28 09:57:39 +02:00
Boaz Leskes db5e225a25 Discovery: fix `discovery.zen.join_timeout` default value logic
We default the value to be 20x the value of a ping timeout, however we only use the legacy ping timeout settings value for the calculation.

Closes #13162
2015-08-28 09:47:15 +02:00
javanna 9b2e77903d Internal: make ValidationException methods final and fix javadocs 2015-08-28 09:41:47 +02:00
javanna 37ec221df5 Internal: remove unused MapperQueryParser constructor 2015-08-28 09:38:29 +02:00
javanna 24e53b5f8f Internal: remove code duplication in QueryValidationException
The class can now simply extend ValidationException and rely on the base class.
2015-08-28 09:35:43 +02:00
Jason Tedor 90bc784194 Work around for JDK-8039214 on JDK 9 2015-08-27 23:29:22 -04:00
Jason Tedor 3067cacb66 Remove and forbid use of com.google.common.collect.Lists
This commit removes and now forbids all uses of
com.google.common.collect.Lists across the codebase. This is the first
of many steps in the eventual removal of Guava as a dependency.
2015-08-27 22:14:33 -04:00
Igor Motov 2b87d7d919 Add `readonly` option for repositories
Closes #7831
Closes #11753
2015-08-27 18:21:29 -04:00
Nik Everett 19a79c99f9 [test] Use proper comparison operator
lessThanOrEqualTo is more appropriate when comparing _ttl than lessThan
because in rare cases, when tests run very fast, the ttl you fetch will
still equal the one you sent.
2015-08-27 16:43:10 -04:00
Britta Weber e6eeadd171 [test] make sure that the scripts in testScoreAccessWithinScript never compute log(0) 2015-08-27 22:02:51 +02:00
Ryan Ernst 448d3498b1 Merge branch 'master' into fix/bwc_creation 2015-08-27 10:16:45 -07:00
Lee Hinman 9f03f8cf44 Call `beforeIndexShardCreated` listener earlier in `createShard`
Some listeners may need to do work before a shard's path is
accessed (such as creating the directory in a plugin), so the listener
should be called before anything happens (as its name implies).
2015-08-27 10:05:27 -06:00
Nik Everett 9eb684da51 Default detect_noop to true
detect_noop is pretty cheap and noop updates compartively expensive so this
feels like a sensible default.

Also had to do some testing and documentation around how _ttl works with
detect_noop.

Closes #11282
2015-08-27 10:34:18 -04:00
Simon Willnauer 9a1b5cf966 [TEST] comparing paths seems to be hard on windonws 2015-08-27 13:20:22 +02:00
javanna dc807f294e Query DSL: deprecate _name and boost in short variants of queries
As discussed in #11744 this is the last step to unify parsing of boost and _name. Those fields are supported only in long version of queries, while we sometimes parse them when wwe shouldn't, inconsistently.

Closes #11744
Closes #12966
2015-08-27 12:24:42 +02:00
André Carvalho 793fcb6998 Warmers: delete _all should not throw exception when no warmers are registered
Closes #8991
Closes #13058
2015-08-27 12:24:42 +02:00
Jason Tedor a867a950ab Merge pull request #13135 from jasontedor/fix/eliminate-tuple-as-a-method-parameter
Remove usage of tuple as a method parameter
2015-08-27 04:57:26 -04:00
Simon Willnauer 03ccb99cd5 Expose shards data and state path via ShardStats
Since we now don't stripe shards across data paths we need a way
to access the information on which path a shard is allocated to
eventually do better allocation decisions based on disk usage etc.
This commit exposes the shard paths as part of the shard stats.

Relates to #13106
2015-08-27 09:42:56 +02:00
Ryan Ernst 1029b119d9 Tests: Fix generation scripts for bwc indexes, and add 2.0 beta1 index 2015-08-26 19:36:26 -07:00
Jason Tedor a1408ef622 Remove usage of tuple as a method parameter
This commit removes all instances of
org.elasticsearch.common.collect.Tuple as a method parameter.

Closes #10787
2015-08-26 22:07:33 -04:00
xuzha fb2be6d6a1 The name "position_offset_gap" is confusing because Lucene has three
similar sounding things:

* Analyzer#getPositionIncrementGap
* Analyzer#getOffsetGap
* IndexOptions.DOCS_AND_FREQS_AND_POSITIONS_AND_OFFSETS and
* FieldType#storeTermVectorOffsets

Rename position_offset_gap to position_increment_gap
closes #13056
2015-08-26 14:56:35 -07:00
javanna 350cba98cf [TEST] make MockTermsLookupFetchService non static 2015-08-26 15:56:47 +02:00
javanna 94dd6c5f0e [TEST] unify parsing code in tests
Also clean up static method in MoreLikeThisFetchService, fix randomly failing TermsQueryBuilderTest#testNullValues and rename mappedFieldNamesSmall to MAPPED_LEAF_FIELD_NAMES.
2015-08-26 15:50:01 +02:00
Martijn van Groningen a0565f00dd Removed the `operation_threaded` option.
This low level option isn't worth the complexity and an operation should never happen on the network thread.
2015-08-26 15:21:50 +02:00
Martijn van Groningen 3b400aafd6 parent/child: use the index searcher from engine searcher directly for JoinUtil based impl
and use the provided index searcher directly for the pre 2.0 parent/child imp.
2015-08-26 15:03:11 +02:00
Colin Goodheart-Smithe bd0753eaa3 Merge pull request #13033 from xuzha/xu-12391
Print field name when meet unexpected token.
2015-08-26 14:41:08 +02:00
Alex Ksikes 1af0a39221 Refactors TermsQueryBuilder and Parser
Refactors TermsQueryBuilder and Parser for #10217.

This PR is against the query-refactoring branch.

Closes #12042
2015-08-26 13:58:46 +02:00
Boaz Leskes 95c097bf24 Tests: use assertHitCount instead of direct assertion on hits in metric tests
So we will get more info on failures
2015-08-26 11:00:48 +02:00
Christoph Büscher efadf87371 Merge branch 'master' into feature/query-refactoring 2015-08-26 10:23:03 +02:00
Nik Everett 3f6108ab74 [Mapping] Move position_offset_gap default change
Until a couple of hours ago we expected the position_offset_gap to default
to 0 in 2.0 and 100 in 2.1. We decided it was worth backporting that new
default to 2.0. So now that its backported we need to teach 2.1 that 2.0
also defaults to 100.

Closes #7268
2015-08-25 18:01:10 -04:00
Nik Everett 4b9664beeb Mapping: Default position_offset_gap to 100
This is much more fiddly than you'd expect it to be because of the way
position_offset_gap is applied in StringFieldMapper. Instead of setting
the default to 100 its simpler to make sure that all the analyzers default
to 100 and that StringFieldMapper doesn't override the default unless the
user specifies something different. Unless the index was created before
2.1, in which case the old default of 0 has to take.

Also postition_offset_gaps less than 0 aren't allowed at all.

New tests test that:
1. the new default doesn't match phrases across values with reasonably low
slop (5)
2. the new default doest match phrases across values with reasonably high
slop (50)
3. you can override the value and phrases work as you'd expect
4. if you leave the value undefined in the mapping and define it on a
custom analyzer the the value from the custom analyzer shines through

Closes #7268
2015-08-25 14:21:50 -04:00
Ryan Ernst d77bcb0d9b Merge pull request #13085 from rjernst/fix/13017
Fix document parsing to properly ignore entire type when disabled
2015-08-25 08:58:07 -07:00
javanna 96b5cebfb1 Merge branch 'master' into feature/query-refactoring
Conflicts:
	core/src/main/java/org/elasticsearch/index/query/QueryStringQueryParser.java
2015-08-25 13:16:46 +02:00
javanna cc12501cef Internal: remove unused code from query_string parser and settings
Closes #13098
2015-08-25 12:53:41 +02:00
Christoph Büscher 59cb67c7bd Merge branch 'master' into feature/query-refactoring
Conflicts:
	core/src/main/java/org/elasticsearch/index/query/support/NestedInnerQueryParseSupport.java
2015-08-25 11:59:40 +02:00
Jason Tedor 8ff1efbcf0 Merge pull request #13082 from jasontedor/feature/13081
Consolidate duplicate logic in RoutingTable all*ShardsGrouped
2015-08-25 05:06:26 -04:00
Martijn van Groningen 9f3043fc78 Merge pull request #13087 from martijnvg/nested/child_filter_can_just_be_regular_filter
Nested query should only use bitset cache for parent filter
2015-08-25 10:13:36 +02:00
Jason Tedor 51ae1c4d53 Merge pull request #13086 from jasontedor/fix/no-duplicate-settings
Detect duplicate settings keys on startup
2015-08-24 20:51:22 -04:00