当前位置: 首页>>代码示例>>Java>>正文


Java Query类代码示例

本文整理汇总了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);
 
开发者ID:ugouku,项目名称:shoucang,代码行数:29,代码来源:PostSearchRepository.java

示例2: findFirstByPath

import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{ \"bool\" : { \"must\" : { \"query\" : { \"term\" : { \"path\": \"?0\" } } } } }")
File findFirstByPath(String path);
 
开发者ID:klask-io,项目名称:klask-io,代码行数:3,代码来源:FileSearchRepository.java

示例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);
 
开发者ID:klask-io,项目名称:klask-io,代码行数:3,代码来源:FileSearchRepository.java

示例4: findByRawVersion

import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"field\" : {\"version.raw\" : \"?0\"}}}}")
Page<File> findByRawVersion(String version, Pageable pageable);
 
开发者ID:klask-io,项目名称:klask-io,代码行数:3,代码来源:FileSearchRepository.java

示例5: findByItemId

import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"term\" : {\"id\" : \"?0\"}}}}")
public List<Weapon> findByItemId(String itemId);
 
开发者ID:wendelfleming,项目名称:USC-LunchNLearn-ElasticSearch,代码行数:3,代码来源:WeaponRepository.java

示例6: findByItemId

import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"term\" : {\"id\" : \"?0\"}}}}")
public List<Armor> findByItemId(String itemId);
 
开发者ID:wendelfleming,项目名称:USC-LunchNLearn-ElasticSearch,代码行数:3,代码来源:ArmorRepository.java

示例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);
 
开发者ID:Ellixo,项目名称:MedicamentDB,代码行数:54,代码来源:MedicamentRepository.java

示例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);
 
开发者ID:gustavoorsi,项目名称:searchahouse.com,代码行数:3,代码来源:PropertyRepository.java

示例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);
 
开发者ID:gustavoorsi,项目名称:searchahouse.com,代码行数:3,代码来源:LocationRepository.java

示例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);
 
开发者ID:gustavoorsi,项目名称:searchahouse.com,代码行数:3,代码来源:AgentRepository.java

示例11: findByMessage

import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"term\" : {\"message\" : \"?0\"}}}}")
Page<Book> findByMessage(String message, Pageable pageable);
 
开发者ID:phstudy,项目名称:SpringMVC-SpringDataElasticsearch,代码行数:3,代码来源:BookRepository.java

示例12: findByPrice

import org.springframework.data.elasticsearch.annotations.Query; //导入依赖的package包/类
@Query("{\"bool\" : {\"must\" : {\"term\" : {\"price\" : \"?0\"}}}}")
Page<Book> findByPrice(Float price, Pageable pageable);
 
开发者ID:ameizi,项目名称:spring-data-elasticsearch-example,代码行数:3,代码来源:BookRepository.java

示例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


注:本文中的org.springframework.data.elasticsearch.annotations.Query类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。