本文整理了Java中com.algolia.search.saas.Query.getFacets
方法的一些代码示例,展示了Query.getFacets
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getFacets
方法的具体详情如下:
包路径:com.algolia.search.saas.Query
类名称:Query
方法名:getFacets
暂无
代码示例来源:origin: algolia/algoliasearch-client-android
@Test
public void facets() {
Query query = new Query();
assertNull(query.getFacets());
query.setFacets("foo", "bar");
assertArrayEquals(new String[]{"foo", "bar"}, query.getFacets());
assertEquals("[\"foo\",\"bar\"]", query.get("facets"));
Query query2 = Query.parse(query.build());
assertArrayEquals(query.getFacets(), query2.getFacets());
}
代码示例来源:origin: algolia/instantsearch-android
String[] facets = searcher.getQuery().getFacets();
Assert.assertEquals("The query should contain one facet.", 1, facets.length);
Assert.assertEquals("The query's facet should be `foo`.", "foo", facets[0]);
facets = searcher.getQuery().getFacets();
Assert.assertEquals("The query should still contain one facet.", 1, facets.length);
Assert.assertEquals("The query's facet should still be `foo`.", "foo", facets[0]);
facets = searcher.getQuery().getFacets();
Assert.assertEquals("The query should still contain one facet.", 1, facets.length);
Assert.assertEquals("The query's facet should still be `foo`.", "foo", facets[0]);
facets = searcher.getQuery().getFacets();
Assert.assertEquals("The query should contain two facets.", 2, facets.length);
Assert.assertEquals("The query's second facet should be `bar`.", "bar", facets[1]);
facets = searcher.getQuery().getFacets();
Assert.assertEquals("The query should now contain one facet.", 1, facets.length);
Assert.assertEquals("The query's facet should now be `bar`.", "bar", facets[0]);
facets = searcher.getQuery().getFacets();
Assert.assertEquals("The query should now contain three facets.", 3, facets.length);
facets = searcher.getQuery().getFacets();
Assert.assertEquals("The query should now contain no facets.", 0, facets.length);
facets = searcher.getQuery().getFacets();
Assert.assertEquals("The query should now contain no facets.", 0, facets.length);
内容来源于网络,如有侵权,请联系作者删除!