Commit Graph

16129 Commits

Author SHA1 Message Date
Colin Goodheart-Smithe ce7dde08d0 fix SearchSourceBuilder.fromXContent to allow sort to be an object 2015-09-23 23:12:36 +01:00
Colin Goodheart-Smithe a163a0fc89 fixed script language plugins rest tests to use correct script syntax 2015-09-23 22:47:37 +01:00
Colin Goodheart-Smithe 3c9e69e15f Parse query from deleteByQuery request body 2015-09-23 22:06:35 +01:00
Colin Goodheart-Smithe 6d307a3cfd delete by query rest test fix (maybe) 2015-09-23 21:42:09 +01:00
Colin Goodheart-Smithe 2dce527b81 rest test fixes (hopefully) 2015-09-23 21:15:13 +01:00
Simon Willnauer c93eeb88ca fix inner_hits parsing in SearchService 2015-09-23 22:05:49 +02:00
Colin Goodheart-Smithe 4996b07205 update rest tests to expect default boost to be returned in warmer responses 2015-09-23 21:02:55 +01:00
Colin Goodheart-Smithe 7a209cc600 more test fixes 2015-09-23 20:52:57 +01:00
Simon Willnauer 04864dc7d7 Impl SearchSource#hashCode|equals|toString 2015-09-23 21:50:30 +02:00
Simon Willnauer 95a7b6aa83 Add a late-parsing SearchSoruce wrapper for index warmers 2015-09-23 21:31:00 +02:00
Colin Goodheart-Smithe 2de450ca0b fixes and debugging 2015-09-23 19:57:59 +01:00
Colin Goodheart-Smithe 85f4c39b69 more test fixes 2015-09-23 18:58:16 +01:00
Colin Goodheart-Smithe 63da68e480 test fixes 2015-09-23 18:50:45 +01:00
Colin Goodheart-Smithe 08ae68c195 Merge branch 'feature/query-refactoring' into feature/search-request-refactoring
# Conflicts:
#	core/src/test/java/org/elasticsearch/search/functionscore/DecayFunctionScoreIT.java
#	core/src/test/java/org/elasticsearch/search/functionscore/FunctionScoreFieldValueIT.java
#	core/src/test/java/org/elasticsearch/search/functionscore/FunctionScoreIT.java
#	core/src/test/java/org/elasticsearch/search/rescore/QueryRescorerIT.java
2015-09-23 18:07:30 +01:00
Colin Goodheart-Smithe 394e551365 removed sysouts 2015-09-23 17:34:28 +01:00
Colin Goodheart-Smithe 52d9664993 fix to sort parsing in SearchService 2015-09-23 17:33:05 +01:00
Colin Goodheart-Smithe 585ed07c5b unit test fixes 2015-09-23 17:26:18 +01:00
Christoph Büscher dbb01f5b43 Query Refactoring: Move MoreLikeThisQueryBuilder validation to constructor
The current MoreLikeThisQueryBuilder validation checks for existence of at
least one `like` text or item. This is hard to check in setters, so this PR
tries to change the construction of the query so that we can do these checks
already at construction time.

Changing to using arrays for fieldnames, likeTexts, likeItems, unlikeTexts
and unlikeItems. `likeTexts` and/or `likeItems` need to be specified at
construction time to validate we have at least one item there.

Relates to #10217
2015-09-23 18:20:46 +02:00
Colin Goodheart-Smithe 2e3cc50a0f removed sysout 2015-09-23 16:57:25 +01:00
Colin Goodheart-Smithe d7429a6c63 Search service can now fully populate SearchContext from SearchSourceBuilder 2015-09-23 16:40:58 +01:00
Colin Goodheart-Smithe a53cf896dc Parsing of rescuer and sort ByteReferences.
Not the neatest implementation in the world. Maybe we should consider changing the builders so it is a single builder for sort and a single builder for rescore instead of a list of builders for each?
2015-09-23 15:43:35 +01:00
Colin Goodheart-Smithe 083f28a704 remove index from QueryParseContext Constructor 2015-09-23 15:07:33 +01:00
Simon Willnauer 6c335f4a47 Parse source, extra-source and template-source on the coordinating node
This commit removes all the opaque bytes for extra_source and template_source.
Instead source and extra_source etc. are represented as SearchSourceBuilder which can
in-place be modified and is updated with the content of the request parameters.
Template Source is parsed and evaluated which in-turn replaces the actual source.
2015-09-23 12:24:07 +02:00
Colin Goodheart-Smithe ac8c1722ac fix compile errors 2015-09-23 11:07:20 +01:00
Colin Goodheart-Smithe b98f7cf023 updates to fix some of the NOCOMMITs 2015-09-23 10:44:24 +01:00
Colin Goodheart-Smithe ab01ec5b28 SearchRequest.source() now returns a SearchSourceBuilder.
Lots of NOCOMMITS are in the code as lots of compile errors have been temporarily commented out
2015-09-23 10:44:23 +01:00
Colin Goodheart-Smithe 41e63505b9 muted failing test 2015-09-23 10:44:23 +01:00
Colin Goodheart-Smithe aa3d29dfbc small parsing fix for fields 2015-09-23 10:44:23 +01:00
Colin Goodheart-Smithe b4dd6a5429 fixes to tests 2015-09-23 10:44:23 +01:00
Colin Goodheart-Smithe 3cb3514474 clean up for methods in SearchRequestBuilder so it works with SearchSourceBuilder 2015-09-23 10:44:23 +01:00
Colin Goodheart-Smithe e1759b1a60 cleanup codebase to work with SearchSourceBuilder 2015-09-23 10:44:22 +01:00
Colin Goodheart-Smithe 9116c1c19f Renamed SearchSourceBuilder to OldSearchSourceBuilder and NewSearchSourceBuilder to SearchSourceBuilder 2015-09-23 10:44:22 +01:00
Colin Goodheart-Smithe 3c8c6c0250 Completed serialisation to/from son and transport protocol and added a unit test 2015-09-23 10:44:22 +01:00
Colin Goodheart-Smithe eed6ab7b82 various fixes after a review 2015-09-23 10:44:22 +01:00
Colin Goodheart-Smithe e73052bce2 cleanup of commented out code 2015-09-23 10:44:22 +01:00
Colin Goodheart-Smithe 5623dd2950 implemented hashCode, equals and fromXContent in NewSearchSourceBuidler 2015-09-23 10:44:22 +01:00
Colin Goodheart-Smithe a96f14ecc6 new SearchSourceBuilder to use as the search request 2015-09-23 10:44:22 +01:00
javanna 7eedd84dc3 Query refactoring: refactor query_string query and score functions
Refactor the function_score query so it can be parsed on the coordinating node, split parse into fromXContent and toQuery, make FunctionScoreQueryBuilder Writeable.

Closes #13653
2015-09-23 11:32:54 +02:00
javanna 6350470ee3 Remove index member from QueryParseContext
Given that we are moving to parsing queries on the coordinating node, the index name is not relevant anymore in QueryParseContext, as the parsing phase cannot be related to any specific index. On the contrary, the QueryShardContext is the one that holds mappings etc. and the index name too, as the lucene query creation happens on the data node and can still be related with the index that it happens against.

Changes are mainly around tests that were expecting the index name, moved to using QueryShardException in some of them, removed the index name elsewhere.

Closes #13631
2015-09-23 10:30:53 +02:00
Christoph Büscher 5ebb074e57 Fixing warnings and errors in javadoc 2015-09-22 13:59:34 +02:00
Christoph Büscher 1aae68d2e8 Merge branch 'master' into feature/query-refactoring
Conflicts:
	core/src/main/java/org/elasticsearch/index/query/CommonTermsQueryBuilder.java
	core/src/main/java/org/elasticsearch/index/query/GeoPolygonQueryBuilder.java
	core/src/main/java/org/elasticsearch/index/query/MatchQueryBuilder.java
	core/src/main/java/org/elasticsearch/index/query/QueryParseContext.java
	core/src/main/java/org/elasticsearch/index/query/QueryParser.java
2015-09-22 12:43:55 +02:00
Christoph Büscher 7d887a1e05 Tests: fix failing GeoDistanceRangeQueryTest 2015-09-22 12:13:53 +02:00
Clinton Gormley 86f201e84a Merge pull request #13688 from nik9000/docs_http_settings
Note that no http settings are dynamic
2015-09-22 11:55:34 +02:00
Britta Weber 997ea08e7b remove tests. they are fragile, hard to debug and add no value
closes #13542
closes #13343
closes #13316
2015-09-22 11:42:24 +02:00
Christoph Büscher 03035a28a3 Query Refactoring: moving validation to setters and constructors
Moving validation from validate() to constructors and setters for the
following query builders:

* GeoDistanceQueryBuilder
* GeoDistanceRangeQueryBuilder
* GeoPolygonQueryBuilder
* GeoShapeQueryBuilder
* GeohashCellQuery
* TermsQueryBuilder

Relates to #10217
2015-09-22 11:05:56 +02:00
Simon Willnauer ac2be641b3 add missing license header 2015-09-22 10:03:19 +02:00
Simon Willnauer bf0eb0910c Merge pull request #13615 from s1monw/base_parser
Add a ObjectParser helper for stream parsing
2015-09-22 09:59:11 +02:00
Simon Willnauer 2c9a280878 only set matcher if parser is not null 2015-09-22 09:34:00 +02:00
Simon Willnauer 5f258b1585 Add a ObjectParser helper for stream parsing
This parser prototype allows to decleratively define parsers for XContent
instead of writing messy and error prone while loops. It encapsulates all the error handling logic
and only even tries to parse if the token types match the declaration.
2015-09-22 09:26:17 +02:00
Ryan Ernst de2566a023 Merge pull request #13704 from rjernst/more_rest_spec_cleanup
Move a couple more rest-api-spec resource dirs into resources
2015-09-21 22:10:58 -07:00