Commit Graph

16119 Commits

Author SHA1 Message Date
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
Ryan Ernst 093791e82d Test: Move a couple more rest-api-spec resource dirs into resources
A couple were left behind. This fixes them and cleans up the test
resources for qa tests a little bit.
2015-09-21 21:57:51 -07:00
Robert Muir b582de79ae Merge pull request #13702 from rmuir/broke_javadocs
Fix all javadocs issues, re-enable compiler warnings (but disable on java 9 where maven is broken)
2015-09-22 00:46:31 -04:00
Robert Muir f401350a97 Fix straggler in qa tests 2015-09-21 23:43:24 -04:00
Robert Muir 2f67cacaa3 Fix all javadocs issues, re-enable compiler warnings (but disable on java9 where maven is broken) 2015-09-21 23:35:32 -04:00
Ryan Ernst 8aa6aec344 Merge pull request #13663 from rjernst/license_cleanup
Remove unnecessary copies of license and notice files
2015-09-21 18:04:57 -07:00
Nik Everett eedb39a5a9 Merge pull request #13689 from nik9000/javadocs_8
Disable doclint
2015-09-21 17:02:11 -04:00
Nik Everett 6876321581 Merge 'RestUtils.decodeQueryString ignores the URI fragment when parsing a query string'
Fixes #13365
2015-09-21 15:59:11 -04:00
Camilo Díaz Repka c2b3b8d983 Teach decodeQueryString about fragments
Fixes #13320
2015-09-21 15:50:29 -04:00
Robert Muir 7bcdae28ca Merge pull request #13695 from rmuir/factor_out_scripts
Get lang-javascript, lang-python, securemock ready for script refactoring
2015-09-21 15:44:08 -04:00
Robert Muir f0733bd829 Get lang-javascript, lang-python, securemock ready for script refactoring.
I want to refactor scripting engines so we can contain dangerous "God-like" permissions
like createClassloader/sun.reflect. These are used for dynamic class generation (scripts, mocks).
This will mean some refactoring to ES core.

But first lets get the plugins in order first. I removed those permissions globally, and
fixed grants for lang-javascript, lang-python, securemock so that everything works.

lang-javascript needs no code changes, because rhino is properly written :)
lang-python needs accesscontroller blocks. securemock was already working as of 1.1

This is just a baby step, to try to do some of this incrementally! It doesn't yet provide
us anything.
2015-09-21 15:13:17 -04:00