本文整理汇总了Java中org.springframework.data.elasticsearch.annotations.Query类的典型用法代码示例。如果您正苦于以下问题:Java Query类的具体用法?Java Query怎么用?Java Query使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Query类属于org.springframework.data.elasticsearch.annotations包,在下文中一共展示了Query类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchUserPosts
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{" +
" \"bool\": {" +
" \"must\": [" +
" {" +
" \"term\": {" +
" \"user.login\": \"?1\"" +
" }" +
" }, " +
" {" +
" \"bool\": {" +
" \"should\": [" +
" {" +
" \"match\": {" +
" \"title\": \"?0\"" +
" }" +
" }, " +
" {" +
" \"match\": {" +
" \"tags.friendly_name\": \"?0\"" +
" }" +
" }" +
" ]" +
" }" +
" }" +
" ]" +
" }" +
" }")
Page<Post> searchUserPosts(String query, String login, Pageable pageable);
示例2: findFirstByPath
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{ \"bool\" : { \"must\" : { \"query\" : { \"term\" : { \"path\": \"?0\" } } } } }")
File findFirstByPath(String path);
示例3: findByRawVersionIn
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"bool\" : {\"should\" : [ {\"field\" : {\"version.raw\" : \"?\"}}, {\"field\" : {\"version.raw\" : \"?\"}} ]}}}}")
Page<File> findByRawVersionIn(Collection<String> version, Pageable pageable);
示例4: findByRawVersion
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"field\" : {\"version.raw\" : \"?0\"}}}}")
Page<File> findByRawVersion(String version, Pageable pageable);
示例5: findByItemId
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"term\" : {\"id\" : \"?0\"}}}}")
public List<Weapon> findByItemId(String itemId);
示例6: findByItemId
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"term\" : {\"id\" : \"?0\"}}}}")
public List<Armor> findByItemId(String itemId);
示例7: searchAll
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{" +
" \"bool\" : {" +
" \"minimum_should_match\" : 1," +
" \"should\" : [" +
" {" +
" \"match_phrase_prefix\" : {" +
" \"raw_denomination\": {" +
" \"query\": \"?0\"," +
" \"boost\": 5" +
" }" +
" }" +
" }," +
" {" +
" \"match_phrase_prefix\" : {" +
" \"folded_denomination\": {" +
" \"query\": \"?0\"," +
" \"boost\": 5" +
" }" +
" }" +
" }," +
" {" +
" \"match_phrase_prefix\" : {" +
" \"compositions.substancesActives.denominationSubstance\": {" +
" \"query\": \"?0\"," +
" \"boost\": 5" +
" }" +
" " +
" }" +
" }," +
" {" +
" \"match_phrase_prefix\" : {" +
" \"folded_denomination\": {" +
" \"query\": \"?0\"," +
" \"fuzziness\": \"1\"," +
" \"prefix_length\" : 3," +
" \"boost\": 2" +
" }" +
" " +
" }" +
" }," +
" {" +
" \"match_phrase_prefix\" : {" +
" \"_all\": {" +
" \"query\": \"?0\"," +
" \"fuzziness\": \"1\"," +
" \"prefix_length\" : 3" +
" }" +
" }" +
" }" +
" ]" +
" }" +
" }")
Page<Medicament> searchAll(String criteria, Pageable pageable);
示例8: findPropertiesByAutocompleteAddress
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query(name = "search_property_autocomplete", value = "{\"multi_match\" : { \"query\" : \"?0\",\"fuzziness\":2,\"prefix_length\":1, \"fields\" : [\"address.state.autocomplete\",\"address.city.autocomplete\",\"address.street\"] } }")
public Page<Property> findPropertiesByAutocompleteAddress(final String autocompleteAddress, Pageable pageable);
示例9: findAutocompleteLocationState
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query(name = "autocomplete_state", value = "{\"match\" : { \"state.autocomplete\" : { \"query\" : \"?0\", \"analyzer\" : \"standard\" } } }")
public List<Location> findAutocompleteLocationState(final String autocompleteState);
示例10: findAutocompleteAgentsByFirstName
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query(name = "autocomplete_firstName", value = "{\"match\" : { \"firstName.autocomplete\" : { \"query\" : \"?0\", \"analyzer\" : \"standard\" } } }")
public List<Agent> findAutocompleteAgentsByFirstName(final String autocompleteFirstName);
示例11: findByMessage
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"term\" : {\"message\" : \"?0\"}}}}")
Page<Book> findByMessage(String message, Pageable pageable);
示例12: findByPrice
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"term\" : {\"price\" : \"?0\"}}}}")
Page<Book> findByPrice(Float price, Pageable pageable);
示例13:
import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{ \"bool\":{ \"must\":[ {\"query_string\":{\"query\":\"?0\",\"fields\":[\"tenantId\"]}},{\"query_string\":{\"query\":\"?1\",\"fields\":[\"[email protected]\"]}}]}}")
Page<EventElasticsearch> findByTenantIdAndEventGroupIdWhereGroupIdContains(String tenantId, String context, Pageable pageable);
开发者ID:Apereo-Learning-Analytics-Initiative,项目名称:OpenLRS,代码行数:3,代码来源:ElasticsearchEventRepository.java