manymobi

elasticsearch 界的 mybatis

  •  
  •   manymobi · Apr 26, 2021 · 6020 views
    This topic created in 1886 days ago, the information mentioned may be changed or developed.

    TestMapper 和 esdsl/test.esdsl 文件内容

    https://github.com/manymobi/esdsl-core/blob/master/images/esdsl.png

    @Mapper("esdsl/test.esdsl")
    public interface TestMapper {
    
        JSONObject search(@Param("content") String content);
    
        JSONObject search1(@Param("sssss") String sssss, @Param("list") List list);
    
        @Query("{\"ssss\":#{sssss},\"integer\":#{integer}}")
        @RequestMapping(method = RequestMethod.GET, value = "/v")
        JSONObject search2(@Param("sssss") String sssss, @Param("integer") Integer integer);
    
        @RequestMapping(method = RequestMethod.GET, value = "/v")
        JSONObject search3(@RequestBody String sssss);
    
    }
    
    ==> search
    GET /index/${fulltext}/_search
    {
      "query" : {
    	#if(232=="rwerwe")
        "match" : {
          "id" :123133131223123212313131
          }
    	#endif
      },
       "highlight" : {
            "pre_tags" : ["<tag1>", "<tag2>"],
            "post_tags" : ["</tag1>", "</tag2>"],
            "fields" : {
                "content" : #{content}
            }
        }
    }
    

    仓库地址 https://github.com/manymobi/esdsl-core

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3214 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 00:30 · PVG 08:30 · LAX 17:30 · JFK 20:30
    ♥ Do have faith in what you're doing.