mirror of
https://github.com/spring-projects/spring-data-elasticsearch.git
synced 2025-10-13 05:48:55 +00:00
DATAES-2 - all code reformatted to follow Spring Data code rules
This commit is contained in:
parent
f768c1698e
commit
e9a260235d
@ -133,7 +133,7 @@ Searching entities using Elasticsearch Template
|
||||
Indexing a single document with Repository
|
||||
|
||||
```java
|
||||
@Resource
|
||||
@Autowired
|
||||
private SampleElasticsearchRepository repository;
|
||||
|
||||
String documentId = "123456";
|
||||
@ -147,7 +147,7 @@ Indexing a single document with Repository
|
||||
Indexing multiple Document(bulk index) using Repository
|
||||
|
||||
```java
|
||||
@Resource
|
||||
@Autowired
|
||||
private SampleElasticsearchRepository repository;
|
||||
|
||||
String documentId = "123456";
|
||||
@ -371,6 +371,11 @@ Here are some ways for you to get involved in the community:
|
||||
|
||||
Before we accept a non-trivial patch or pull request we will need you to sign the [contributor's agreement](https://support.springsource.com/spring_committer_signup). Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.
|
||||
|
||||
|
||||
Code formatting for [Eclipse and Intellij](https://github.com/spring-projects/spring-data-build/tree/master/etc/ide)
|
||||
|
||||
[More information about contributing to Spring Data](https://github.com/spring-projects/spring-data-build/blob/master/CONTRIBUTING.md)
|
||||
|
||||
### Contact Details
|
||||
|
||||
* Rizwan Idrees (rizwan.idrees@biomedcentral.com)
|
||||
|
820
formatting.xml
820
formatting.xml
@ -1,820 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="12">
|
||||
<profile kind="CodeFormatterProfile" name="Spring Data"
|
||||
version="12">
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag"
|
||||
value="@formatter:off" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration"
|
||||
value="end_of_line" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field"
|
||||
value="0" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line"
|
||||
value="false" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression"
|
||||
value="80" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer"
|
||||
value="end_of_line" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package"
|
||||
value="1" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation"
|
||||
value="2" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk"
|
||||
value="1" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package"
|
||||
value="0" />
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="1.7" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type"
|
||||
value="1" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.align_type_members_on_columns"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration"
|
||||
value="0" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size"
|
||||
value="2" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag"
|
||||
value="@formatter:on" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration"
|
||||
value="16" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment"
|
||||
value="0" />
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier"
|
||||
value="error" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char"
|
||||
value="tab" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body"
|
||||
value="true" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method"
|
||||
value="1" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration"
|
||||
value="end_of_line" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration"
|
||||
value="0" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch"
|
||||
value="end_of_line" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier"
|
||||
value="error" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch"
|
||||
value="false" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block"
|
||||
value="end_of_line" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration"
|
||||
value="end_of_line" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant"
|
||||
value="end_of_line" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size"
|
||||
value="2" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case"
|
||||
value="end_of_line" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve"
|
||||
value="1" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.7" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer"
|
||||
value="2" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration"
|
||||
value="end_of_line" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode"
|
||||
value="enabled" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line"
|
||||
value="true" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments"
|
||||
value="true" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length"
|
||||
value="120" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups"
|
||||
value="1" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration"
|
||||
value="end_of_line" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body"
|
||||
value="0" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations"
|
||||
value="1" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration"
|
||||
value="16" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports"
|
||||
value="1" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration"
|
||||
value="16" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer"
|
||||
value="insert" />
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform"
|
||||
value="1.7" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try"
|
||||
value="80" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation"
|
||||
value="0" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.comment.format_block_comments"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant"
|
||||
value="do not insert" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants"
|
||||
value="0" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration"
|
||||
value="end_of_line" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries"
|
||||
value="true" />
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports"
|
||||
value="1" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header"
|
||||
value="true" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for"
|
||||
value="insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments"
|
||||
value="do not insert" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column"
|
||||
value="false" />
|
||||
<setting
|
||||
id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line"
|
||||
value="false" />
|
||||
</profile>
|
||||
</profiles>
|
3
pom.xml
3
pom.xml
@ -1,5 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.springframework.data</groupId>
|
||||
|
@ -21,7 +21,8 @@
|
||||
<para>
|
||||
Version Control -
|
||||
<ulink
|
||||
url="git://github.com/BioMedCentralLtd/spring-data-elasticsearch.git">git://github.com/BioMedCentralLtd/spring-data-elasticsearch.git
|
||||
url="git://github.com/BioMedCentralLtd/spring-data-elasticsearch.git">
|
||||
git://github.com/BioMedCentralLtd/spring-data-elasticsearch.git
|
||||
</ulink>
|
||||
</para>
|
||||
</listitem>
|
||||
|
@ -99,14 +99,16 @@ http://www.springframework.org/schema/data/elasticsearch/spring-elasticsearch-1.
|
||||
</title>
|
||||
<programlisting language="java">
|
||||
@Configuration
|
||||
@EnableElasticsearchRepositories(basePackages = "org/springframework/data/elasticsearch/repositories")
|
||||
@EnableElasticsearchRepositories(basePackages =
|
||||
"org/springframework/data/elasticsearch/repositories")
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
public ElasticsearchOperations elasticsearchTemplate() {
|
||||
return new ElasticsearchTemplate(nodeBuilder().local(true).node().client());
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
The configuration above sets up an
|
||||
<classname>Embedded Elasticsearch Server</classname>
|
||||
@ -154,7 +156,8 @@ public Page<Product> findAvailableBookByName(String name, Pageable pageabl
|
||||
public void setRepository(ProductRepository repository) {
|
||||
this.repository = repository;
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
</section>
|
||||
@ -197,9 +200,11 @@ public void setRepository(ProductRepository repository) {
|
||||
translates into:
|
||||
<example>
|
||||
<title>Query creation from method names</title>
|
||||
<programlisting language="java">public interface BookRepository extends Repository<Book, String> {
|
||||
<programlisting language="java">public interface BookRepository extends Repository<Book, String>
|
||||
{
|
||||
List<Book> findByNameAndPrice(String name, Integer price);
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
<para>
|
||||
The method name above will be translated into the following
|
||||
Elasticsearch json query
|
||||
@ -210,7 +215,8 @@ public void setRepository(ProductRepository repository) {
|
||||
[
|
||||
{ "field" : {"name" : "?"} },
|
||||
{ "field" : {"price" : "?"} }
|
||||
] } }</programlisting>
|
||||
] } }
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
@ -238,7 +244,8 @@ public void setRepository(ProductRepository repository) {
|
||||
</entry>
|
||||
<entry>
|
||||
<code>{"bool" : {"must" : [ {"field" : {"name" : "?"}},
|
||||
{"field" : {"price" : "?"}} ]}}</code>
|
||||
{"field" : {"price" : "?"}} ]}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -250,7 +257,8 @@ public void setRepository(ProductRepository repository) {
|
||||
</entry>
|
||||
<entry>
|
||||
<code>{"bool" : {"should" : [ {"field" : {"name" : "?"}},
|
||||
{"field" : {"price" : "?"}} ]}}</code>
|
||||
{"field" : {"price" : "?"}} ]}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -299,7 +307,8 @@ public void setRepository(ProductRepository repository) {
|
||||
<entry>
|
||||
<code>{"bool" : {"must" : {"range" : {"price" : {"from" :
|
||||
null,"to" : ?,"include_lower" : true,"include_upper" :
|
||||
true}}}}}</code>
|
||||
true}}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -312,7 +321,8 @@ public void setRepository(ProductRepository repository) {
|
||||
<entry>
|
||||
<code>{"bool" : {"must" : {"range" : {"price" : {"from" :
|
||||
?,"to" : null,"include_lower" : true,"include_upper" :
|
||||
true}}}}}</code>
|
||||
true}}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -325,7 +335,8 @@ public void setRepository(ProductRepository repository) {
|
||||
<entry>
|
||||
<code>{"bool" : {"must" : {"range" : {"price" : {"from" :
|
||||
null,"to" : ?,"include_lower" : true,"include_upper" :
|
||||
true}}}}}</code>
|
||||
true}}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -338,7 +349,8 @@ public void setRepository(ProductRepository repository) {
|
||||
<entry>
|
||||
<code>{"bool" : {"must" : {"range" : {"price" : {"from" :
|
||||
?,"to" : null,"include_lower" : true,"include_upper" :
|
||||
true}}}}}</code>
|
||||
true}}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -350,7 +362,8 @@ public void setRepository(ProductRepository repository) {
|
||||
</entry>
|
||||
<entry>
|
||||
<code>{"bool" : {"must" : {"field" : {"name" : {"query" :
|
||||
"?*","analyze_wildcard" : true}}}}}</code>
|
||||
"?*","analyze_wildcard" : true}}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -362,7 +375,8 @@ public void setRepository(ProductRepository repository) {
|
||||
</entry>
|
||||
<entry>
|
||||
<code>{"bool" : {"must" : {"field" : {"name" : {"query" :
|
||||
"?*","analyze_wildcard" : true}}}}}</code>
|
||||
"?*","analyze_wildcard" : true}}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -374,7 +388,8 @@ public void setRepository(ProductRepository repository) {
|
||||
</entry>
|
||||
<entry>
|
||||
<code>{"bool" : {"must" : {"field" : {"name" : {"query" :
|
||||
"*?","analyze_wildcard" : true}}}}}</code>
|
||||
"*?","analyze_wildcard" : true}}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -386,7 +401,8 @@ public void setRepository(ProductRepository repository) {
|
||||
</entry>
|
||||
<entry>
|
||||
<code>{"bool" : {"must" : {"field" : {"name" : {"query" :
|
||||
"*?*","analyze_wildcard" : true}}}}}</code>
|
||||
"*?*","analyze_wildcard" : true}}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -398,7 +414,8 @@ public void setRepository(ProductRepository repository) {
|
||||
</entry>
|
||||
<entry>
|
||||
<code>{"bool" : {"must" : {"bool" : {"should" : [ {"field" :
|
||||
{"name" : "?"}}, {"field" : {"name" : "?"}} ]}}}}</code>
|
||||
{"name" : "?"}}, {"field" : {"name" : "?"}} ]}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -410,7 +427,8 @@ public void setRepository(ProductRepository repository) {
|
||||
</entry>
|
||||
<entry>
|
||||
<code>{"bool" : {"must_not" : {"bool" : {"should" : {"field" :
|
||||
{"name" : "?"}}}}}}</code>
|
||||
{"name" : "?"}}}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
@ -457,7 +475,8 @@ public void setRepository(ProductRepository repository) {
|
||||
</entry>
|
||||
<entry>
|
||||
<code>{"sort" : [{ "name" : {"order" : "desc"} }],"bool" :
|
||||
{"must" : {"field" : {"available" : true}}}}</code>
|
||||
{"must" : {"field" : {"available" : true}}}}
|
||||
</code>
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
@ -474,10 +493,12 @@ public void setRepository(ProductRepository repository) {
|
||||
annotation.
|
||||
</title>
|
||||
|
||||
<programlisting language="java">public interface BookRepository extends ElasticsearchRepository<Book, String> {
|
||||
<programlisting language="java">public interface BookRepository extends ElasticsearchRepository<Book,
|
||||
String> {
|
||||
@Query("{"bool" : {"must" : {"field" : {"name" : "?0"}}}}")
|
||||
Page<Book> findByName(String name,Pageable pageable);
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
|
||||
|
@ -28,7 +28,8 @@ SearchQuery searchQuery = new NativeSearchQueryBuilder()
|
||||
.withQuery(matchAllQuery())
|
||||
.withFilter(boolFilter().must(termFilter("id", documentId)))
|
||||
.build();
|
||||
Page<SampleEntity> sampleEntities = elasticsearchTemplate.queryForPage(searchQuery,SampleEntity.class);
|
||||
Page<SampleEntity> sampleEntities =
|
||||
elasticsearchTemplate.queryForPage(searchQuery,SampleEntity.class);
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
@ -55,7 +56,8 @@ String scrollId = elasticsearchTemplate.scan(searchQuery,1000,false);
|
||||
List<SampleEntity> sampleEntities = new ArrayList<SampleEntity>();
|
||||
boolean hasRecords = true;
|
||||
while (hasRecords){
|
||||
Page<SampleEntity> page = elasticsearchTemplate.scroll(scrollId, 5000L , new ResultsMapper<SampleEntity>() {
|
||||
Page<SampleEntity> page = elasticsearchTemplate.scroll(scrollId, 5000L , new ResultsMapper<SampleEntity>()
|
||||
{
|
||||
@Override
|
||||
public Page<SampleEntity> mapResults(SearchResponse response) {
|
||||
List<SampleEntity> chunk = new ArrayList<SampleEntity>();
|
||||
@ -79,7 +81,8 @@ for(SearchHit searchHit : response.getHits()){
|
||||
hasRecords = false;
|
||||
}
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
</chapter>
|
@ -100,7 +100,8 @@
|
||||
boolean exists(ID primaryKey);
|
||||
|
||||
// … more functionality omitted.
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
<calloutlist>
|
||||
<callout arearefs="repository.save">
|
||||
@ -151,12 +152,14 @@
|
||||
<example>
|
||||
<title>PagingAndSortingRepository</title>
|
||||
|
||||
<programlisting language="java">public interface PagingAndSortingRepository<T, ID extends Serializable> extends CrudRepository<T, ID> {
|
||||
<programlisting language="java">public interface PagingAndSortingRepository<T, ID extends Serializable>
|
||||
extends CrudRepository<T, ID> {
|
||||
|
||||
Iterable<T> findAll(Sort sort);
|
||||
|
||||
Page<T> findAll(Pageable pageable);
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
@ -166,8 +169,10 @@
|
||||
size of 20 you could simply do something like this:
|
||||
</para>
|
||||
|
||||
<programlisting language="java">PagingAndSortingRepository<User, Long> repository = // … get access to a bean
|
||||
Page<User> users = repository.findAll(new PageRequest(1, 20));</programlisting>
|
||||
<programlisting language="java">PagingAndSortingRepository<User, Long> repository = // … get access to a
|
||||
bean
|
||||
Page<User> users = repository.findAll(new PageRequest(1, 20));
|
||||
</programlisting>
|
||||
</section>
|
||||
|
||||
<section id="repositories.query-methods">
|
||||
@ -188,7 +193,9 @@
|
||||
and type it to the domain class it shall handle.
|
||||
</para>
|
||||
|
||||
<programlisting language="java">public interface PersonRepository extends Repository<User, Long> { … }</programlisting>
|
||||
<programlisting language="java">public interface PersonRepository extends Repository<User, Long> {
|
||||
… }
|
||||
</programlisting>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
@ -240,7 +247,8 @@
|
||||
|
||||
public void doSomething() {
|
||||
List<Person> persons = repository.findByLastname("Matthews");
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
@ -295,7 +303,8 @@
|
||||
<example>
|
||||
<title>Selectively exposing CRUD methods</title>
|
||||
|
||||
<programlisting language="java">interface MyBaseRepository<T, ID extends Serializable> extends Repository<T, ID> {
|
||||
<programlisting language="java">interface MyBaseRepository<T, ID extends Serializable> extends
|
||||
Repository<T, ID> {
|
||||
T findOne(ID id);
|
||||
T save(T entity);
|
||||
}
|
||||
@ -303,7 +312,8 @@
|
||||
interface UserRepository extends MyBaseRepository<User, Long> {
|
||||
|
||||
User findByEmailAddress(EmailAddress emailAddress);
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
@ -434,10 +444,13 @@
|
||||
<title>Query creation from method names</title>
|
||||
|
||||
<para>
|
||||
<programlisting language="java">public interface PersonRepository extends Repository<User, Long> {
|
||||
<programlisting language="java">public interface PersonRepository extends Repository<User,
|
||||
Long> {
|
||||
|
||||
List<Person> findByEmailAddressAndLastname(EmailAddress emailAddress, String lastname);
|
||||
}</programlisting>
|
||||
List<Person> findByEmailAddressAndLastname(EmailAddress emailAddress, String
|
||||
lastname);
|
||||
}
|
||||
</programlisting>
|
||||
</para>
|
||||
</example>
|
||||
|
||||
@ -482,7 +495,8 @@
|
||||
of
|
||||
</para>
|
||||
|
||||
<programlisting language="java">List<Person> findByAddressZipCode(ZipCode zipCode);</programlisting>
|
||||
<programlisting language="java">List<Person> findByAddressZipCode(ZipCode zipCode);
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
will create the property traversal
|
||||
@ -551,7 +565,8 @@
|
||||
|
||||
List<User> findByLastname(String lastname, Sort sort);
|
||||
|
||||
List<User> findByLastname(String lastname, Pageable pageable);</programlisting>
|
||||
List<User> findByLastname(String lastname, Pageable pageable);
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
@ -665,7 +680,8 @@
|
||||
details see
|
||||
<ulink
|
||||
url="http://static.springsource.org/spring/docs/2.5.x/reference/beans.html#beans-scanning-filters"
|
||||
vendor="">Spring reference documentation</ulink>
|
||||
vendor="">Spring reference documentation
|
||||
</ulink>
|
||||
on these
|
||||
elements.
|
||||
</para>
|
||||
@ -727,7 +743,8 @@
|
||||
public EntityManagerFactory entityManagerFactory() {
|
||||
// …
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
@ -759,7 +776,8 @@
|
||||
<title>Standalone usage of repository factory</title>
|
||||
|
||||
<programlisting language="java">RepositoryFactorySupport factory = … // Instantiate factory here
|
||||
UserRepository repository = factory.getRepository(UserRepository.class);</programlisting>
|
||||
UserRepository repository = factory.getRepository(UserRepository.class);
|
||||
</programlisting>
|
||||
</example>
|
||||
</section>
|
||||
</section>
|
||||
@ -789,7 +807,8 @@
|
||||
<programlisting language="java">interface UserRepositoryCustom {
|
||||
|
||||
public void someCustomMethod(User user);
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
@ -801,7 +820,8 @@
|
||||
public void someCustomMethod(User user) {
|
||||
// Your custom implementation
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
Note that the implementation itself does not depend on
|
||||
Spring Data and can be a regular Spring bean. So you can use standard
|
||||
dependency injection behaviour to inject references to other beans,
|
||||
@ -813,10 +833,12 @@
|
||||
<title>Changes to the your basic repository interface</title>
|
||||
|
||||
<para>
|
||||
<programlisting language="java">public interface UserRepository extends CrudRepository<User, Long>, UserRepositoryCustom {
|
||||
<programlisting language="java">public interface UserRepository extends CrudRepository<User, Long>,
|
||||
UserRepositoryCustom {
|
||||
|
||||
// Declare query methods here
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
Let your standard repository interface extend the custom
|
||||
one. This makes CRUD and custom functionality available to
|
||||
clients.
|
||||
@ -844,7 +866,8 @@
|
||||
<para>
|
||||
<programlisting language="xml"><repositories base-package="com.acme.repository" />
|
||||
|
||||
<repositories base-package="com.acme.repository" repository-impl-postfix="FooBar" /></programlisting>
|
||||
<repositories base-package="com.acme.repository" repository-impl-postfix="FooBar"
|
||||
/></programlisting>
|
||||
</para>
|
||||
</example>
|
||||
|
||||
@ -904,7 +927,8 @@
|
||||
extends JpaRepository<T, ID> {
|
||||
|
||||
void sharedCustomMethod(ID id);
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</para>
|
||||
</example>
|
||||
|
||||
@ -969,7 +993,8 @@
|
||||
public void sharedCustomMethod(ID id) {
|
||||
// implementation goes here
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
@ -994,7 +1019,8 @@
|
||||
<title>Custom repository factory bean</title>
|
||||
|
||||
<programlisting language="java">
|
||||
public class MyRepositoryFactoryBean<R extends JpaRepository<T, I>, T, I extends Serializable>
|
||||
public class MyRepositoryFactoryBean<R extends JpaRepository<T, I>, T, I extends
|
||||
Serializable>
|
||||
extends JpaRepositoryFactoryBean<R, T, I> {
|
||||
|
||||
protected RepositoryFactorySupport createRepositoryFactory(EntityManager entityManager) {
|
||||
@ -1002,7 +1028,8 @@
|
||||
return new MyRepositoryFactory(entityManager);
|
||||
}
|
||||
|
||||
private static class MyRepositoryFactory<T, I extends Serializable> extends JpaRepositoryFactory {
|
||||
private static class MyRepositoryFactory<T, I extends Serializable> extends
|
||||
JpaRepositoryFactory {
|
||||
|
||||
private EntityManager entityManager;
|
||||
|
||||
@ -1024,7 +1051,8 @@
|
||||
return MyRepository.class;
|
||||
}
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
@ -1085,7 +1113,8 @@
|
||||
// Populate model
|
||||
return "user";
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
First you pretty much have to declare a repository dependency for
|
||||
@ -1119,7 +1148,8 @@
|
||||
domain class
|
||||
</para>
|
||||
|
||||
<programlisting language="xml"><bean class="….web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
|
||||
<programlisting language="xml"><bean
|
||||
class="….web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
|
||||
<property name="webBindingInitializer">
|
||||
<bean class="….web.bind.support.ConfigurableWebBindingInitializer">
|
||||
<property name="propertyEditorRegistrars">
|
||||
@ -1145,7 +1175,8 @@
|
||||
// Populate model
|
||||
return "userForm";
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
</simplesect>
|
||||
|
||||
<simplesect>
|
||||
@ -1202,7 +1233,8 @@
|
||||
model.addAttribute("users", userService.getUsers(pageable));
|
||||
return "users";
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
As you can see the naive approach requires the method to contain
|
||||
@ -1241,7 +1273,8 @@
|
||||
model.addAttribute("users", userDao.readAll(pageable));
|
||||
return "users";
|
||||
}
|
||||
}</programlisting>
|
||||
}
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
The
|
||||
@ -1386,7 +1419,8 @@
|
||||
"lastname" : "Matthews" },
|
||||
{ "_class" : "com.acme.Person",
|
||||
"firstname" : "Carter",
|
||||
"lastname" : "Beauford" } ]</programlisting>
|
||||
"lastname" : "Beauford" } ]
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
@ -1452,7 +1486,8 @@
|
||||
http://www.springframework.org/schema/oxm
|
||||
http://www.springframework.org/schema/oxm/spring-oxm.xsd">
|
||||
|
||||
<repository:unmarshaller-populator location="classpath:data.json" unmarshaller-ref="unmarshaller" />
|
||||
<repository:unmarshaller-populator location="classpath:data.json" unmarshaller-ref="unmarshaller"
|
||||
/>
|
||||
|
||||
<oxm:jaxb2-marshaller contextPath="com.acme" />
|
||||
|
||||
|
@ -17,7 +17,6 @@ package org.springframework.data.elasticsearch.annotations;
|
||||
|
||||
/**
|
||||
* @author Jakub Vavrik
|
||||
*
|
||||
* Values based on reference doc - http://www.elasticsearch.org/guide/reference/mapping/date-format/
|
||||
*/
|
||||
public enum DateFormat {
|
||||
|
@ -15,10 +15,10 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.annotations;
|
||||
|
||||
import org.springframework.data.annotation.Persistent;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
import org.springframework.data.annotation.Persistent;
|
||||
|
||||
/**
|
||||
* Document
|
||||
*
|
||||
|
@ -44,5 +44,4 @@ public @interface Field {
|
||||
String indexAnalyzer() default "";
|
||||
|
||||
String[] ignoreFields() default {};
|
||||
|
||||
}
|
||||
|
@ -30,5 +30,6 @@ import org.springframework.data.annotation.Persistent;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface Parent {
|
||||
|
||||
String type();
|
||||
}
|
||||
|
@ -42,5 +42,4 @@ public @interface Query {
|
||||
* @return
|
||||
*/
|
||||
String name() default "";
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.client;
|
||||
|
||||
import static org.elasticsearch.node.NodeBuilder.*;
|
||||
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.common.settings.ImmutableSettings;
|
||||
@ -24,8 +26,6 @@ import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
|
||||
import static org.elasticsearch.node.NodeBuilder.nodeBuilder;
|
||||
|
||||
/**
|
||||
* NodeClientFactoryBean
|
||||
*
|
||||
|
@ -15,6 +15,11 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.client;
|
||||
|
||||
import static org.apache.commons.lang.StringUtils.*;
|
||||
import static org.elasticsearch.common.settings.ImmutableSettings.*;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.elasticsearch.client.transport.TransportClient;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||
@ -25,11 +30,6 @@ import org.springframework.beans.factory.FactoryBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import static org.apache.commons.lang.StringUtils.*;
|
||||
import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder;
|
||||
|
||||
/**
|
||||
* TransportClientFactoryBean
|
||||
*
|
||||
|
@ -22,8 +22,6 @@ import org.springframework.beans.factory.xml.ParserContext;
|
||||
import org.springframework.data.elasticsearch.client.TransportClientFactoryBean;
|
||||
import org.w3c.dom.Element;
|
||||
|
||||
import static org.apache.commons.lang.StringUtils.split;
|
||||
|
||||
/**
|
||||
* TransportClientBeanDefinitionParser
|
||||
*
|
||||
|
@ -15,11 +15,11 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import org.springframework.data.elasticsearch.ElasticsearchException;
|
||||
import static org.apache.commons.lang.StringUtils.*;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.apache.commons.lang.StringUtils.isBlank;
|
||||
import org.springframework.data.elasticsearch.ElasticsearchException;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
|
@ -15,19 +15,21 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import org.elasticsearch.index.query.*;
|
||||
import org.springframework.data.elasticsearch.core.geo.GeoBox;
|
||||
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
|
||||
import org.springframework.data.elasticsearch.core.query.Criteria;
|
||||
import org.springframework.util.Assert;
|
||||
import static org.elasticsearch.index.query.FilterBuilders.*;
|
||||
import static org.springframework.data.elasticsearch.core.query.Criteria.*;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import static org.elasticsearch.index.query.FilterBuilders.*;
|
||||
import static org.springframework.data.elasticsearch.core.query.Criteria.OperationKey;
|
||||
import org.elasticsearch.index.query.FilterBuilder;
|
||||
import org.elasticsearch.index.query.GeoBoundingBoxFilterBuilder;
|
||||
import org.elasticsearch.index.query.GeoDistanceFilterBuilder;
|
||||
import org.springframework.data.elasticsearch.core.geo.GeoBox;
|
||||
import org.springframework.data.elasticsearch.core.geo.GeoPoint;
|
||||
import org.springframework.data.elasticsearch.core.query.Criteria;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* CriteriaFilterProcessor
|
||||
@ -119,7 +121,6 @@ class CriteriaFilterProcessor {
|
||||
} else {
|
||||
((GeoDistanceFilterBuilder) filter).geohash(loc).distance(dist);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
@ -145,7 +146,6 @@ class CriteriaFilterProcessor {
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return filter;
|
||||
|
@ -15,19 +15,19 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||
import org.elasticsearch.index.query.BoostableQueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.springframework.data.elasticsearch.core.query.Criteria;
|
||||
import org.springframework.util.Assert;
|
||||
import static org.elasticsearch.index.query.QueryBuilders.*;
|
||||
import static org.springframework.data.elasticsearch.core.query.Criteria.*;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import static org.elasticsearch.index.query.QueryBuilders.*;
|
||||
import static org.springframework.data.elasticsearch.core.query.Criteria.OperationKey;
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||
import org.elasticsearch.index.query.BoostableQueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.springframework.data.elasticsearch.core.query.Criteria;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* CriteriaQueryProcessor
|
||||
@ -47,7 +47,6 @@ class CriteriaQueryProcessor {
|
||||
List<QueryBuilder> mustNotQueryBuilderList = new LinkedList<QueryBuilder>();
|
||||
List<QueryBuilder> mustQueryBuilderList = new LinkedList<QueryBuilder>();
|
||||
|
||||
|
||||
ListIterator<Criteria> chainIterator = criteria.getCriteriaChain().listIterator();
|
||||
while (chainIterator.hasNext()) {
|
||||
Criteria chainedCriteria = chainIterator.next();
|
||||
@ -168,7 +167,5 @@ class CriteriaQueryProcessor {
|
||||
if (query instanceof BoostableQueryBuilder) {
|
||||
((BoostableQueryBuilder) query).boost(boost);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,11 +15,11 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* DocumentMapper using jackson
|
||||
*
|
||||
|
@ -16,6 +16,14 @@
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.elasticsearch.action.get.GetResponse;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.common.base.Strings;
|
||||
@ -34,14 +42,6 @@ import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersiste
|
||||
import org.springframework.data.mapping.PersistentProperty;
|
||||
import org.springframework.data.mapping.context.MappingContext;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
*/
|
||||
|
@ -15,14 +15,14 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.elasticsearch.action.update.UpdateResponse;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.elasticsearch.core.convert.ElasticsearchConverter;
|
||||
import org.springframework.data.elasticsearch.core.query.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* ElasticsearchOperations
|
||||
*
|
||||
|
@ -15,6 +15,18 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
|
||||
import static org.apache.commons.lang.StringUtils.*;
|
||||
import static org.elasticsearch.action.search.SearchType.*;
|
||||
import static org.elasticsearch.client.Requests.*;
|
||||
import static org.elasticsearch.common.collect.Sets.*;
|
||||
import static org.elasticsearch.index.VersionType.*;
|
||||
import static org.springframework.data.elasticsearch.core.MappingBuilder.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
|
||||
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequestBuilder;
|
||||
@ -59,21 +71,6 @@ import org.springframework.data.elasticsearch.core.query.*;
|
||||
import org.springframework.data.mapping.PersistentProperty;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
|
||||
import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
|
||||
import static org.apache.commons.lang.StringUtils.isBlank;
|
||||
import static org.apache.commons.lang.StringUtils.isNotBlank;
|
||||
import static org.elasticsearch.action.search.SearchType.DFS_QUERY_THEN_FETCH;
|
||||
import static org.elasticsearch.action.search.SearchType.SCAN;
|
||||
import static org.elasticsearch.client.Requests.indicesExistsRequest;
|
||||
import static org.elasticsearch.client.Requests.refreshRequest;
|
||||
import static org.elasticsearch.common.collect.Sets.newHashSet;
|
||||
import static org.elasticsearch.index.VersionType.EXTERNAL;
|
||||
import static org.springframework.data.elasticsearch.core.MappingBuilder.buildMapping;
|
||||
|
||||
/**
|
||||
* ElasticsearchTemplate
|
||||
*
|
||||
@ -639,7 +636,6 @@ public class ElasticsearchTemplate implements ElasticsearchOperations {
|
||||
if (id != null) {
|
||||
return String.valueOf(id);
|
||||
}
|
||||
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
@ -684,7 +680,6 @@ public class ElasticsearchTemplate implements ElasticsearchOperations {
|
||||
private static String[] toArray(List<String> values) {
|
||||
String[] valuesAsArray = new String[values.size()];
|
||||
return values.toArray(valuesAsArray);
|
||||
|
||||
}
|
||||
|
||||
protected ResultsMapper getResultsMapper() {
|
||||
|
@ -15,13 +15,12 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
* @author Artur Konczak
|
||||
@ -34,5 +33,4 @@ public interface FacetedPage<T> extends Page<T> {
|
||||
List<FacetResult> getFacets();
|
||||
|
||||
FacetResult getFacet(String name);
|
||||
|
||||
}
|
||||
|
@ -15,15 +15,15 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetResult;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Container for query result and facet results
|
||||
*
|
||||
|
@ -24,5 +24,4 @@ import org.elasticsearch.action.get.GetResponse;
|
||||
public interface GetResultMapper {
|
||||
|
||||
<T> T mapResult(GetResponse response, Class<T> clazz);
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,14 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import static org.apache.commons.lang.StringUtils.*;
|
||||
import static org.elasticsearch.common.xcontent.XContentFactory.*;
|
||||
import static org.springframework.util.StringUtils.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.springframework.core.GenericCollectionTypeResolver;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
@ -25,15 +33,6 @@ import org.springframework.data.mapping.model.SimpleTypeHolder;
|
||||
import org.springframework.data.util.ClassTypeInformation;
|
||||
import org.springframework.data.util.TypeInformation;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.apache.commons.lang.StringUtils.EMPTY;
|
||||
import static org.apache.commons.lang.StringUtils.isNotBlank;
|
||||
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
|
||||
import static org.springframework.util.StringUtils.hasText;
|
||||
|
||||
/**
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
@ -124,7 +123,6 @@ class MappingBuilder {
|
||||
if (!isRootObject && isAnyPropertyAnnotatedAsField(fields)) {
|
||||
xContentBuilder.endObject().endObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static boolean isAnnotated(java.lang.reflect.Field field) {
|
||||
@ -306,5 +304,4 @@ class MappingBuilder {
|
||||
private static boolean isGeoField(java.lang.reflect.Field field) {
|
||||
return field.getType() == GeoPoint.class || field.getAnnotation(GeoPointField.class) != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -26,5 +26,4 @@ package org.springframework.data.elasticsearch.core;
|
||||
public interface ResultsMapper extends SearchResultMapper, GetResultMapper {
|
||||
|
||||
EntityMapper getEntityMapper();
|
||||
|
||||
}
|
||||
|
@ -24,5 +24,4 @@ import org.springframework.data.domain.Pageable;
|
||||
public interface SearchResultMapper {
|
||||
|
||||
<T> FacetedPage<T> mapResults(SearchResponse response, Class<T> clazz, Pageable pageable);
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.convert;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.joda.time.DateTimeZone;
|
||||
import org.joda.time.LocalDateTime;
|
||||
import org.joda.time.ReadableInstant;
|
||||
@ -22,8 +24,6 @@ import org.joda.time.format.DateTimeFormatter;
|
||||
import org.joda.time.format.ISODateTimeFormat;
|
||||
import org.springframework.core.convert.converter.Converter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* DateTimeConverters
|
||||
*
|
||||
@ -74,5 +74,4 @@ public final class DateTimeConverters {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -42,5 +42,4 @@ public interface ElasticsearchConverter {
|
||||
* @return never {@literal null}.
|
||||
*/
|
||||
ConversionService getConversionService();
|
||||
|
||||
}
|
||||
|
@ -62,5 +62,4 @@ public class MappingElasticsearchConverter implements ElasticsearchConverter, Ap
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
this.applicationContext = applicationContext;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,12 +23,12 @@ import org.springframework.util.Assert;
|
||||
* @author Artur Konczak
|
||||
* @author Jonathan Yan
|
||||
*/
|
||||
public class AbstactFacetResult implements FacetResult {
|
||||
public class AbstractFacetResult implements FacetResult {
|
||||
|
||||
private final String name;
|
||||
private final FacetType type;
|
||||
|
||||
protected AbstactFacetResult(String name, FacetType type) {
|
||||
protected AbstractFacetResult(String name, FacetType type) {
|
||||
Assert.hasText(name, "Facet name can't be null and should have a value");
|
||||
this.name = name;
|
||||
this.type = type;
|
@ -15,6 +15,9 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.facet;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.elasticsearch.search.facet.Facet;
|
||||
import org.elasticsearch.search.facet.histogram.HistogramFacet;
|
||||
import org.elasticsearch.search.facet.range.RangeFacet;
|
||||
@ -22,9 +25,6 @@ import org.elasticsearch.search.facet.statistical.StatisticalFacet;
|
||||
import org.elasticsearch.search.facet.terms.TermsFacet;
|
||||
import org.springframework.data.elasticsearch.core.facet.result.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
* @author Petar Tahchiev
|
||||
@ -78,5 +78,4 @@ public class DefaultFacetMapper {
|
||||
}
|
||||
return new HistogramResult(facet.getName(), entries);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,5 +28,4 @@ public interface FacetRequest {
|
||||
FacetBuilder getFacet();
|
||||
|
||||
boolean applyQueryFilter();
|
||||
|
||||
}
|
||||
|
@ -22,12 +22,10 @@ package org.springframework.data.elasticsearch.core.facet;
|
||||
* @author Mohsin Husen
|
||||
* @author Artur Konczak
|
||||
* @author Jonathan Yan
|
||||
*
|
||||
*/
|
||||
public interface FacetResult {
|
||||
|
||||
String getName();
|
||||
|
||||
FacetType getType();
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.facet.request;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.elasticsearch.search.facet.FacetBuilder;
|
||||
import org.elasticsearch.search.facet.FacetBuilders;
|
||||
@ -22,8 +24,6 @@ import org.elasticsearch.search.facet.histogram.HistogramFacetBuilder;
|
||||
import org.springframework.data.elasticsearch.core.facet.AbstractFacetRequest;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
* @author Mohsin Husen
|
||||
|
@ -15,10 +15,10 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.facet.request;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetRequest;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetRequest;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
*/
|
||||
|
@ -15,6 +15,9 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.facet.request;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.elasticsearch.search.facet.FacetBuilder;
|
||||
import org.elasticsearch.search.facet.FacetBuilders;
|
||||
@ -22,9 +25,6 @@ import org.elasticsearch.search.facet.range.RangeFacetBuilder;
|
||||
import org.springframework.data.elasticsearch.core.facet.AbstractFacetRequest;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Range facet for numeric fields
|
||||
*
|
||||
|
@ -15,15 +15,15 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.facet.result;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.facet.AbstactFacetResult;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.facet.AbstractFacetResult;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetType;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
*/
|
||||
public class HistogramResult extends AbstactFacetResult {
|
||||
public class HistogramResult extends AbstractFacetResult {
|
||||
|
||||
private List<IntervalUnit> terms;
|
||||
|
||||
@ -35,5 +35,4 @@ public class HistogramResult extends AbstactFacetResult {
|
||||
public List<IntervalUnit> getIntervalUnit() {
|
||||
return terms;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,11 +15,11 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.facet.result;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.facet.AbstactFacetResult;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.facet.AbstractFacetResult;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetType;
|
||||
|
||||
/**
|
||||
* Basic term facet result
|
||||
*
|
||||
@ -28,7 +28,7 @@ import java.util.List;
|
||||
* @author Artur Konczak
|
||||
* @author Jonathan Yan
|
||||
*/
|
||||
public class RangeResult extends AbstactFacetResult {
|
||||
public class RangeResult extends AbstractFacetResult {
|
||||
|
||||
private List<Range> ranges;
|
||||
|
||||
@ -40,5 +40,4 @@ public class RangeResult extends AbstactFacetResult {
|
||||
public List<Range> getRanges() {
|
||||
return ranges;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,13 +15,13 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.facet.result;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.facet.AbstactFacetResult;
|
||||
import org.springframework.data.elasticsearch.core.facet.AbstractFacetResult;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetType;
|
||||
|
||||
/**
|
||||
* @author Petar Tahchiev
|
||||
*/
|
||||
public class StatisticalResult extends AbstactFacetResult {
|
||||
public class StatisticalResult extends AbstractFacetResult {
|
||||
|
||||
private long count;
|
||||
|
||||
|
@ -15,11 +15,11 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.facet.result;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.facet.AbstactFacetResult;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.facet.AbstractFacetResult;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetType;
|
||||
|
||||
/**
|
||||
* Basic term facet result
|
||||
*
|
||||
@ -28,7 +28,7 @@ import java.util.List;
|
||||
* @author Artur Konczak
|
||||
* @author Jonathan Yan
|
||||
*/
|
||||
public class TermResult extends AbstactFacetResult {
|
||||
public class TermResult extends AbstractFacetResult {
|
||||
|
||||
private List<Term> terms;
|
||||
|
||||
@ -40,5 +40,4 @@ public class TermResult extends AbstactFacetResult {
|
||||
public List<Term> getTerms() {
|
||||
return terms;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,5 +37,4 @@ public class GeoBox {
|
||||
public GeoPoint getBottomRight() {
|
||||
return bottomRight;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,5 +41,4 @@ public class GeoPoint {
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,5 +37,4 @@ public interface ElasticsearchPersistentProperty extends PersistentProperty<Elas
|
||||
return source.getFieldName();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,13 +15,13 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.mapping;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import org.springframework.data.mapping.context.AbstractMappingContext;
|
||||
import org.springframework.data.mapping.model.SimpleTypeHolder;
|
||||
import org.springframework.data.util.TypeInformation;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
/**
|
||||
* SimpleElasticsearchMappingContext
|
||||
*
|
||||
@ -42,5 +42,4 @@ public class SimpleElasticsearchMappingContext extends
|
||||
SimpleElasticsearchPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) {
|
||||
return new SimpleElasticsearchPersistentProperty(field, descriptor, owner, simpleTypeHolder);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,10 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.mapping;
|
||||
|
||||
import static org.springframework.util.StringUtils.*;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
@ -27,15 +31,10 @@ import org.springframework.data.util.TypeInformation;
|
||||
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static org.springframework.util.StringUtils.hasText;
|
||||
|
||||
/**
|
||||
* Elasticsearch specific {@link org.springframework.data.mapping.PersistentEntity} implementation holding
|
||||
*
|
||||
* @param <T>
|
||||
*
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
*/
|
||||
|
@ -15,16 +15,16 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.mapping;
|
||||
|
||||
import org.springframework.data.mapping.Association;
|
||||
import org.springframework.data.mapping.PersistentEntity;
|
||||
import org.springframework.data.mapping.model.AnnotationBasedPersistentProperty;
|
||||
import org.springframework.data.mapping.model.SimpleTypeHolder;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.data.mapping.Association;
|
||||
import org.springframework.data.mapping.PersistentEntity;
|
||||
import org.springframework.data.mapping.model.AnnotationBasedPersistentProperty;
|
||||
import org.springframework.data.mapping.model.SimpleTypeHolder;
|
||||
|
||||
/**
|
||||
* Elasticsearch specific {@link org.springframework.data.mapping.PersistentProperty} implementation processing
|
||||
*
|
||||
@ -62,5 +62,4 @@ public class SimpleElasticsearchPersistentProperty extends
|
||||
protected Association<ElasticsearchPersistentProperty> createAssociation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.query;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.util.Assert;
|
||||
import static org.apache.commons.collections.CollectionUtils.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.apache.commons.collections.CollectionUtils.addAll;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* AbstractQuery
|
||||
|
@ -15,11 +15,11 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.query;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.elasticsearch.index.query.FilterBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
/**
|
||||
*
|
||||
* @author Mohsin Husen
|
||||
*/
|
||||
public class AliasBuilder {
|
||||
|
@ -14,8 +14,11 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.query;
|
||||
import org.elasticsearch.index.query.FilterBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.elasticsearch.index.query.FilterBuilder;
|
||||
|
||||
/**
|
||||
* AliasQuery is useful for creating new alias or deleting existing ones
|
||||
*
|
||||
|
@ -15,13 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.query;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
@ -508,7 +502,6 @@ public class Criteria {
|
||||
public String getConjunctionOperator() {
|
||||
return OR_OPERATOR;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public enum OperationKey {
|
||||
@ -532,7 +525,5 @@ public class Criteria {
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -77,5 +77,4 @@ public class CriteriaQuery extends AbstractQuery {
|
||||
public Criteria getCriteria() {
|
||||
return this.criteria;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -29,5 +29,4 @@ public interface Field {
|
||||
* @return
|
||||
*/
|
||||
String getName();
|
||||
|
||||
}
|
||||
|
@ -15,13 +15,13 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.query;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import static org.apache.commons.collections.CollectionUtils.*;
|
||||
import static org.springframework.data.elasticsearch.core.query.AbstractQuery.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.apache.commons.collections.CollectionUtils.addAll;
|
||||
import static org.springframework.data.elasticsearch.core.query.AbstractQuery.DEFAULT_PAGE;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
/**
|
||||
* MoreLikeThisQuery
|
||||
|
@ -15,15 +15,15 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.query;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.elasticsearch.index.query.FilterBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.elasticsearch.search.highlight.HighlightBuilder;
|
||||
import org.elasticsearch.search.sort.SortBuilder;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetRequest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* NativeSearchQuery
|
||||
*
|
||||
|
@ -15,6 +15,9 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.query;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.elasticsearch.index.query.FilterBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
@ -23,9 +26,6 @@ import org.elasticsearch.search.sort.SortBuilder;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetRequest;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* NativeSearchQuery
|
||||
*
|
||||
|
@ -15,12 +15,12 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Query
|
||||
*
|
||||
@ -111,6 +111,7 @@ public interface Query {
|
||||
|
||||
/**
|
||||
* Get minimum score
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
float getMinScore();
|
||||
|
@ -15,14 +15,14 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core.query;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.elasticsearch.index.query.FilterBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.elasticsearch.search.highlight.HighlightBuilder;
|
||||
import org.elasticsearch.search.sort.SortBuilder;
|
||||
import org.springframework.data.elasticsearch.core.facet.FacetRequest;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* NativeSearchQuery
|
||||
*
|
||||
@ -31,6 +31,7 @@ import java.util.List;
|
||||
* @author Artur Konczak
|
||||
*/
|
||||
public interface SearchQuery extends Query {
|
||||
|
||||
QueryBuilder getQuery();
|
||||
|
||||
FilterBuilder getFilter();
|
||||
|
@ -38,5 +38,4 @@ public class SimpleField implements Field {
|
||||
public String toString() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
}
|
@ -46,5 +46,4 @@ public class StringQuery extends AbstractQuery {
|
||||
public String getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
|
||||
/**
|
||||
* @param <T>
|
||||
* @param <ID>
|
||||
*
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
* @author Oliver Gierke
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@ -22,12 +24,9 @@ import org.springframework.data.elasticsearch.core.FacetedPage;
|
||||
import org.springframework.data.elasticsearch.core.query.SearchQuery;
|
||||
import org.springframework.data.repository.NoRepositoryBean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @param <T>
|
||||
* @param <ID>
|
||||
*
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
*/
|
||||
|
@ -15,17 +15,17 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.cdi;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
import org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory;
|
||||
import org.springframework.data.repository.cdi.CdiRepositoryBean;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.enterprise.context.spi.CreationalContext;
|
||||
import javax.enterprise.inject.spi.Bean;
|
||||
import javax.enterprise.inject.spi.BeanManager;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
import org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactory;
|
||||
import org.springframework.data.repository.cdi.CdiRepositoryBean;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Uses CdiRepositoryBean to create ElasticsearchRepository instances.
|
||||
*
|
||||
@ -55,5 +55,4 @@ public class ElasticsearchRepositoryBean<T> extends CdiRepositoryBean<T> {
|
||||
public Class<? extends Annotation> getScope() {
|
||||
return elasticsearchOperationsBean.getScope();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,10 +15,6 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.cdi;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
import org.springframework.data.repository.cdi.CdiRepositoryBean;
|
||||
import org.springframework.data.repository.cdi.CdiRepositoryExtensionSupport;
|
||||
|
||||
import javax.enterprise.event.Observes;
|
||||
import javax.enterprise.inject.UnsatisfiedResolutionException;
|
||||
import javax.enterprise.inject.spi.AfterBeanDiscovery;
|
||||
@ -32,6 +28,10 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
import org.springframework.data.repository.cdi.CdiRepositoryBean;
|
||||
import org.springframework.data.repository.cdi.CdiRepositoryExtensionSupport;
|
||||
|
||||
/**
|
||||
* ElasticsearchRepositoryExtension
|
||||
*
|
||||
|
@ -15,11 +15,11 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.config;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
import org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport;
|
||||
import org.springframework.data.repository.config.RepositoryConfigurationExtension;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
||||
/**
|
||||
* {@link org.springframework.context.annotation.ImportBeanDefinitionRegistrar} implementation to trigger configuration
|
||||
* of the {@link EnableElasticsearchRepositories} annotation.
|
||||
|
@ -15,14 +15,14 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.config;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan.Filter;
|
||||
import org.springframework.context.annotation.Import;
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchTemplate;
|
||||
import org.springframework.data.elasticsearch.repository.support.ElasticsearchRepositoryFactoryBean;
|
||||
import org.springframework.data.repository.query.QueryLookupStrategy.Key;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* Annotation to enable Elasticsearch repositories. Will scan the package of the annotated configuration class for
|
||||
* Spring Data repositories by default.
|
||||
|
@ -41,5 +41,4 @@ public abstract class AbstractElasticsearchRepositoryQuery implements Repository
|
||||
public QueryMethod getQueryMethod() {
|
||||
return queryMethod;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,8 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.query;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.data.elasticsearch.annotations.Query;
|
||||
import org.springframework.data.elasticsearch.repository.support.ElasticsearchEntityInformation;
|
||||
@ -23,8 +25,6 @@ import org.springframework.data.repository.core.RepositoryMetadata;
|
||||
import org.springframework.data.repository.query.QueryMethod;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* ElasticsearchQueryMethod
|
||||
*
|
||||
@ -56,5 +56,4 @@ public class ElasticsearchQueryMethod extends QueryMethod {
|
||||
private Query getQueryAnnotation() {
|
||||
return this.method.getAnnotation(Query.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,9 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.query;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.springframework.core.convert.support.GenericConversionService;
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
import org.springframework.data.elasticsearch.core.convert.DateTimeConverters;
|
||||
@ -22,9 +25,6 @@ import org.springframework.data.elasticsearch.core.query.StringQuery;
|
||||
import org.springframework.data.repository.query.ParametersParameterAccessor;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* ElasticsearchStringQuery
|
||||
*
|
||||
@ -48,7 +48,6 @@ public class ElasticsearchStringQuery extends AbstractElasticsearchRepositoryQue
|
||||
if (!conversionService.canConvert(org.joda.time.LocalDateTime.class, String.class)) {
|
||||
conversionService.addConverter(DateTimeConverters.JodaLocalDateTimeConverter.INSTANCE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ElasticsearchStringQuery(ElasticsearchQueryMethod queryMethod,
|
||||
|
@ -15,6 +15,9 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.query.parser;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty;
|
||||
@ -27,9 +30,6 @@ import org.springframework.data.repository.query.parser.AbstractQueryCreator;
|
||||
import org.springframework.data.repository.query.parser.Part;
|
||||
import org.springframework.data.repository.query.parser.PartTree;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* ElasticsearchQueryCreator
|
||||
*
|
||||
@ -133,5 +133,4 @@ public class ElasticsearchQueryCreator extends AbstractQueryCreator<CriteriaQuer
|
||||
}
|
||||
return new Object[]{o};
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,14 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.support;
|
||||
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.data.domain.*;
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
import org.springframework.data.elasticsearch.core.FacetedPage;
|
||||
import org.springframework.data.elasticsearch.core.query.*;
|
||||
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
|
||||
import org.springframework.util.Assert;
|
||||
import static org.elasticsearch.index.query.QueryBuilders.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.ParameterizedType;
|
||||
@ -32,14 +25,19 @@ import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static org.elasticsearch.index.query.QueryBuilders.inQuery;
|
||||
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.data.domain.*;
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
import org.springframework.data.elasticsearch.core.FacetedPage;
|
||||
import org.springframework.data.elasticsearch.core.query.*;
|
||||
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* Elasticsearch specific repository implementation. Likely to be used as target within
|
||||
* {@link ElasticsearchRepositoryFactory}
|
||||
*
|
||||
*
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
* @author Ryan Henszey
|
||||
|
@ -15,14 +15,13 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.support;
|
||||
|
||||
import org.springframework.data.repository.core.EntityInformation;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.data.repository.core.EntityInformation;
|
||||
|
||||
/**
|
||||
* @param <T>
|
||||
* @param <ID>
|
||||
*
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
*/
|
||||
|
@ -26,5 +26,4 @@ import java.io.Serializable;
|
||||
public interface ElasticsearchEntityInformationCreator {
|
||||
|
||||
<T, ID extends Serializable> ElasticsearchEntityInformation<T, ID> getEntityInformation(Class<T> domainClass);
|
||||
|
||||
}
|
||||
|
@ -15,13 +15,13 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentEntity;
|
||||
import org.springframework.data.elasticsearch.core.mapping.ElasticsearchPersistentProperty;
|
||||
import org.springframework.data.mapping.context.MappingContext;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* ElasticsearchEntityInformationCreatorImpl
|
||||
*
|
||||
|
@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.support;
|
||||
|
||||
import static org.springframework.data.querydsl.QueryDslUtils.QUERY_DSL_PRESENT;
|
||||
import static org.springframework.data.querydsl.QueryDslUtils.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Method;
|
||||
@ -117,5 +117,4 @@ public class ElasticsearchRepositoryFactory extends RepositoryFactorySupport {
|
||||
return new ElasticsearchPartQuery(queryMethod, elasticsearchOperations);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.repository.support;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
import org.springframework.data.repository.Repository;
|
||||
import org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport;
|
||||
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Spring {@link org.springframework.beans.factory.FactoryBean} implementation to ease container based configuration for
|
||||
* XML namespace and JavaConfig.
|
||||
@ -59,5 +59,4 @@ public class ElasticsearchRepositoryFactoryBean<T extends Repository<S, ID>, S,
|
||||
protected RepositoryFactorySupport createRepositoryFactory() {
|
||||
return new ElasticsearchRepositoryFactory(operations);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @param <T>
|
||||
* @param <ID>
|
||||
*
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
* @author Ryan Henszey
|
||||
|
@ -21,7 +21,6 @@ import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
* Elasticsearch specific repository implementation. Likely to be used as target within
|
||||
* {@link ElasticsearchRepositoryFactory}
|
||||
*
|
||||
*
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
* @author Ryan Henszey
|
||||
@ -45,5 +44,4 @@ public class NumberKeyedRepository<T, ID extends Number> extends AbstractElastic
|
||||
protected String stringIdRepresentation(ID id) {
|
||||
return String.valueOf(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -21,7 +21,6 @@ import org.springframework.data.elasticsearch.core.ElasticsearchOperations;
|
||||
* Elasticsearch specific repository implementation. Likely to be used as target within
|
||||
* {@link ElasticsearchRepositoryFactory}
|
||||
*
|
||||
*
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
* @author Ryan Henszey
|
||||
@ -45,5 +44,4 @@ public class SimpleElasticsearchRepository<T> extends AbstractElasticsearchRepos
|
||||
protected String stringIdRepresentation(String id) {
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,7 +17,8 @@
|
||||
<xsd:complexContent>
|
||||
<xsd:extension base="repository:repositories">
|
||||
<xsd:attributeGroup ref="repository:repository-attributes"/>
|
||||
<xsd:attribute name="elasticsearch-template-ref" type="elasticsearchTemplateRef" default="elasticsearchTemplate" />
|
||||
<xsd:attribute name="elasticsearch-template-ref" type="elasticsearchTemplateRef"
|
||||
default="elasticsearchTemplate"/>
|
||||
</xsd:extension>
|
||||
</xsd:complexContent>
|
||||
</xsd:complexType>
|
||||
@ -46,12 +47,14 @@
|
||||
<xsd:extension base="beans:identifiedType">
|
||||
<xsd:attribute name="local" type="xsd:boolean" default="false">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[local here means local on the JVM (well, actually class loader) level, meaning that two local servers started within the same JVM will discover themselves and form a cluster]]></xsd:documentation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[local here means local on the JVM (well, actually class loader) level, meaning that two local servers started within the same JVM will discover themselves and form a cluster]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="cluster-name" type="xsd:string" default="elasticsearch">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[Name of the cluster in which this instance of node client will connect to]]> </xsd:documentation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[Name of the cluster in which this instance of node client will connect to]]> </xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="http-enabled" type="xsd:boolean" default="true">
|
||||
@ -76,32 +79,38 @@
|
||||
<xsd:extension base="beans:identifiedType">
|
||||
<xsd:attribute name="cluster-nodes" type="xsd:string" default="127.0.0.1:9300">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[The comma delimited list of host:port entries to use for elasticsearch cluster.]]></xsd:documentation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[The comma delimited list of host:port entries to use for elasticsearch cluster.]]></xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="cluster-name" type="xsd:string" default="elasticsearch">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[Name of the cluster in which this instance of node client will connect to]]> </xsd:documentation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[Name of the cluster in which this instance of node client will connect to]]> </xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="client-transport-sniff" type="xsd:boolean" default="true">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[The client allows to sniff the rest of the cluster, and add those into its list of machines to use.]]> </xsd:documentation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[The client allows to sniff the rest of the cluster, and add those into its list of machines to use.]]> </xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="client-transport-ignore-cluster-name" type="xsd:boolean" default="false">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[Set to true to ignore cluster name validation of connected nodes. (since 0.19.4)]]> </xsd:documentation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[Set to true to ignore cluster name validation of connected nodes. (since 0.19.4)]]> </xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="client-transport-ping-timeout" type="xsd:string" default="5s">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[The time to wait for a ping response from a node. Defaults to 5s.]]> </xsd:documentation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[The time to wait for a ping response from a node. Defaults to 5s.]]> </xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
<xsd:attribute name="client-transport-nodes-sampler-interval" type="xsd:string" default="5s">
|
||||
<xsd:annotation>
|
||||
<xsd:documentation><![CDATA[How often to sample / ping the nodes listed and connected. Defaults to 5s.]]> </xsd:documentation>
|
||||
<xsd:documentation>
|
||||
<![CDATA[How often to sample / ping the nodes listed and connected. Defaults to 5s.]]> </xsd:documentation>
|
||||
</xsd:annotation>
|
||||
</xsd:attribute>
|
||||
</xsd:extension>
|
||||
|
@ -65,5 +65,4 @@ public class DoubleIDEntity {
|
||||
public void setVersion(Long version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,11 +15,11 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Mohsin Husen
|
||||
*/
|
||||
|
@ -65,5 +65,4 @@ public class IntegerIDEntity {
|
||||
public void setVersion(Long version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ package org.springframework.data.elasticsearch;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
/**
|
||||
* MinimalEntity
|
||||
*
|
||||
@ -24,6 +25,7 @@ import org.springframework.data.elasticsearch.annotations.Document;
|
||||
*/
|
||||
@Document(indexName = "index", type = "type")
|
||||
public class MinimalEntity {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
}
|
||||
|
@ -15,6 +15,15 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch;
|
||||
|
||||
import static org.apache.commons.lang.RandomStringUtils.*;
|
||||
import static org.elasticsearch.index.query.QueryBuilders.*;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
import org.junit.Before;
|
||||
@ -31,20 +40,6 @@ import org.springframework.data.elasticsearch.repositories.SampleElasticSearchBo
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
|
||||
import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
|
||||
import static org.elasticsearch.index.query.QueryBuilders.nestedQuery;
|
||||
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
@ -54,7 +49,7 @@ import static org.junit.Assert.assertThat;
|
||||
@ContextConfiguration("classpath:/repository-test-nested-object.xml")
|
||||
public class NestedObjectTests {
|
||||
|
||||
@Resource
|
||||
@Autowired
|
||||
private SampleElasticSearchBookRepository bookRepository;
|
||||
|
||||
@Autowired
|
||||
@ -102,7 +97,6 @@ public class NestedObjectTests {
|
||||
foo.setId("1");
|
||||
foo.setCar(cars);
|
||||
|
||||
|
||||
Car car = new Car();
|
||||
car.setName("Saturn");
|
||||
car.setModel("Imprezza");
|
||||
@ -134,7 +128,6 @@ public class NestedObjectTests {
|
||||
List<Person> persons = elasticsearchTemplate.queryForList(searchQuery, Person.class);
|
||||
|
||||
assertThat(persons.size(), is(1));
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -235,7 +228,6 @@ public class NestedObjectTests {
|
||||
indexQuery1.setId(person1.getId());
|
||||
indexQuery1.setObject(person1);
|
||||
|
||||
|
||||
PersonMultipleLevelNested person2 = new PersonMultipleLevelNested();
|
||||
|
||||
person2.setId("2");
|
||||
@ -252,6 +244,5 @@ public class NestedObjectTests {
|
||||
indexQueries.add(indexQuery2);
|
||||
|
||||
return indexQueries;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ package org.springframework.data.elasticsearch;
|
||||
import org.springframework.core.style.ToStringCreator;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.*;
|
||||
|
||||
/**
|
||||
* ParentEntity
|
||||
*
|
||||
@ -26,6 +27,7 @@ import org.springframework.data.elasticsearch.annotations.*;
|
||||
*/
|
||||
@Document(indexName = ParentEntity.INDEX, type = ParentEntity.PARENT_TYPE, indexStoreType = "memory", shards = 1, replicas = 0, refreshInterval = "-1")
|
||||
public class ParentEntity {
|
||||
|
||||
public static final String INDEX = "parent-child";
|
||||
public static final String PARENT_TYPE = "parent-entity";
|
||||
public static final String CHILD_TYPE = "child-entity";
|
||||
@ -58,6 +60,7 @@ public class ParentEntity {
|
||||
|
||||
@Document(indexName = INDEX, type = CHILD_TYPE, indexStoreType = "memory", shards = 1, replicas = 0, refreshInterval = "-1")
|
||||
public static class ChildEntity {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
@Field(type = FieldType.String, store = true)
|
||||
|
@ -16,13 +16,13 @@
|
||||
package org.springframework.data.elasticsearch;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
|
@ -16,13 +16,13 @@
|
||||
package org.springframework.data.elasticsearch;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
|
@ -15,12 +15,12 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
|
||||
/**
|
||||
* @author Mohsin Husen
|
||||
*/
|
||||
@ -174,5 +174,4 @@ public class Product {
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,21 +1,22 @@
|
||||
package org.springframework.data.elasticsearch;
|
||||
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldIndex.*;
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldType.String;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.DateFormat;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldIndex.not_analyzed;
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldType.String;
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldType.Date;
|
||||
|
||||
/**
|
||||
* @author Jakub Vavrik
|
||||
*/
|
||||
@Document(indexName = "test-datemapping", type = "mapping", indexStoreType = "memory", shards = 1, replicas = 0, refreshInterval = "-1")
|
||||
public class SampleDateMappingEntity {
|
||||
|
||||
@Id
|
||||
private String id;
|
||||
|
||||
|
@ -15,14 +15,12 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch;
|
||||
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldIndex.*;
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldType.String;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldIndex;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldIndex.*;
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldType.*;
|
||||
|
||||
/**
|
||||
* @author Rizwan Idrees
|
||||
@ -56,6 +54,7 @@ public class SampleMappingEntity {
|
||||
}
|
||||
|
||||
static class NestedEntity {
|
||||
|
||||
@Field(type = String)
|
||||
private String someField;
|
||||
|
||||
@ -67,5 +66,4 @@ public class SampleMappingEntity {
|
||||
this.someField = someField;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,14 +15,14 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch;
|
||||
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldIndex.*;
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldType.String;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldIndex.not_analyzed;
|
||||
import static org.springframework.data.elasticsearch.annotations.FieldType.String;
|
||||
|
||||
/**
|
||||
* @author Jakub Vavrik
|
||||
*/
|
||||
@ -55,6 +55,7 @@ public class SampleTransientEntity {
|
||||
}
|
||||
|
||||
static class NestedEntity {
|
||||
|
||||
@Field
|
||||
private static NestedEntity someField = new NestedEntity();
|
||||
@Field
|
||||
@ -68,9 +69,12 @@ public class SampleTransientEntity {
|
||||
this.someField = someField;
|
||||
}
|
||||
|
||||
public Boolean getSomething() { return something; }
|
||||
|
||||
public void setSomething(Boolean something) { this.something = something; }
|
||||
public Boolean getSomething() {
|
||||
return something;
|
||||
}
|
||||
|
||||
public void setSomething(Boolean something) {
|
||||
this.something = something;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,13 +15,13 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.elasticsearch.annotations.Document;
|
||||
import org.springframework.data.elasticsearch.annotations.Field;
|
||||
import org.springframework.data.elasticsearch.annotations.FieldType;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
* @author Mohsin Husen
|
||||
|
@ -15,10 +15,10 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.query.IndexQuery;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import org.springframework.data.elasticsearch.core.query.IndexQuery;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
* @author Mohsin Husen
|
||||
|
@ -15,21 +15,20 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.config;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.hamcrest.core.Is.is;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.elasticsearch.repositories.SampleElasticsearchRepository;
|
||||
import org.springframework.data.elasticsearch.client.NodeClientFactoryBean;
|
||||
import org.springframework.data.elasticsearch.client.TransportClientFactoryBean;
|
||||
import org.springframework.data.elasticsearch.repositories.SampleElasticsearchRepository;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.instanceOf;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.hamcrest.core.Is.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
@ -60,5 +59,4 @@ public class ElasticsearchNamespaceHandlerTests {
|
||||
assertThat(context.getBean(SampleElasticsearchRepository.class),
|
||||
is(instanceOf(SampleElasticsearchRepository.class)));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,10 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.config;
|
||||
|
||||
import static org.elasticsearch.node.NodeBuilder.*;
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -27,11 +31,6 @@ import org.springframework.data.elasticsearch.repository.config.EnableElasticsea
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.elasticsearch.node.NodeBuilder.nodeBuilder;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author Rizwan Idrees
|
||||
* @author Mohsin Husen
|
||||
@ -57,5 +56,4 @@ public class EnableElasticsearchRepositoriesTests {
|
||||
public void bootstrapsRepository() {
|
||||
assertThat(repository, is(notNullValue()));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,16 +15,16 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.springframework.data.elasticsearch.Car;
|
||||
import org.springframework.data.elasticsearch.CarBuilder;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
* @author Mohsin Husen
|
||||
@ -63,5 +63,4 @@ public class DefaultEntityMapperTests {
|
||||
assertThat(result.getName(), is(CAR_NAME));
|
||||
assertThat(result.getModel(), is(CAR_MODEL));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,14 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.collections.iterators.ArrayIterator;
|
||||
import org.elasticsearch.action.get.GetResponse;
|
||||
import org.elasticsearch.action.search.SearchResponse;
|
||||
@ -28,16 +36,6 @@ import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.springframework.data.elasticsearch.Car;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.hamcrest.Matchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
* @author Mohsin Husen
|
||||
@ -133,5 +131,4 @@ public class DefaultResultMapperTests {
|
||||
result.put("model", new InternalSearchHitField("model", Arrays.<Object>asList(model)));
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -15,15 +15,15 @@
|
||||
*/
|
||||
package org.springframework.data.elasticsearch.core;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||
|
||||
import static org.hamcrest.Matchers.is;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
/**
|
||||
* @author Artur Konczak
|
||||
*/
|
||||
@ -48,5 +48,4 @@ public class ElasticsearchTemplateCustomMapperTests {
|
||||
assertThat(elasticsearchTemplate.getResultsMapper(), is(resultsMapper));
|
||||
assertThat(elasticsearchTemplate.getResultsMapper().getEntityMapper(), is(entityMapper));
|
||||
}
|
||||
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user