小编Ary*_*tey的帖子

Espresso、RecyclerView 和 ComposeView

我正在使用 Espresso 来测试 ViewHolder 中带有 RecyclerView 和 ComposeView 的屏幕。我想单击 RecyclerView 中的特定可组合项, 谢谢

android android-testing android-espresso android-recyclerview android-jetpack-compose

5
推荐指数
1
解决办法
850
查看次数

使用Java在Elasticsearch 2.3.3中过滤后查询

我在elasticsearch(v2.3.3)之上构建了一个Web应用程序.要过滤查询,我使用的是elasticsearch的后置过滤器.但我开始知道,如果我使用后置过滤器,那么过滤的性能优势将会丢失,因为我没有使用任何聚合或差分过滤.(参考:https://www.elastic.co/guide/en/elasticsearch/guide/current/_post_filter.html)

这就是我的elasticsearch客户端的样子:

Client client = TransportClient.builder().build().addTransportAddress(
        new InetSocketTransportAddress(InetAddress.getByName("127.0.0.1"),
            9300));
    SearchResponse response = client.prepareSearch("index_name")
        .setTypes("index_type")
        .setQuery(QueryBuilders.simpleQueryStringQuery(query)
            .field("newContent").field("T"))
        .setPostFilter(QueryBuilders.termQuery(Collection, true))
        .setFetchSource(new String[] { "U", "UE", "UD", "T" }, null)
        .setVersion(true).addHighlightedField("newContent").setFrom(0)
        .setSize(10).execute().actionGet();
Run Code Online (Sandbox Code Playgroud)

我还读过过滤查询在elasticsearch 2.x版本中被折旧了.有没有其他方法可以帮助我在执行查询之前应用过滤器?我可能会遗漏一些明显的东西.我很感激你的帮助.

elasticsearch elasticsearch-java-api

2
推荐指数
1
解决办法
1067
查看次数