本文整理了Java中com.algolia.search.saas.Query.setNumericFilters
方法的一些代码示例,展示了Query.setNumericFilters
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setNumericFilters
方法的具体详情如下:
包路径:com.algolia.search.saas.Query
类名称:Query
方法名:setNumericFilters
[英]Add a list of numeric filters separated by a comma. The syntax of one filter is attributeName
followed by operand
followed by value. Supported operands are `` and
>=. You can have multiple conditions on one attribute like for example
numerics=price>100,price
[中]添加由逗号分隔的数字过滤器列表。一个筛选器的语法是'attributeName'后跟'operand'后跟'value'。支持的操作数为``和>=
。在一个属性上可以有多个条件,例如'numerics=price>100,price
代码示例来源:origin: algolia/instantsearch-android
private void rebuildQueryNumericFilters() {
JSONArray numericFilters = new JSONArray();
for (SparseArray<NumericRefinement> refinements : numericRefinements.values()) {
for (int i = 0; i < refinements.size(); i++) {
numericFilters.put(refinements.valueAt(i).toString());
}
}
//noinspection deprecation (deprecated for end-users of API Client)
query.setNumericFilters(numericFilters);
query.setPage(0);
}
代码示例来源:origin: algolia/algoliasearch-client-android
.setNumericFilters(new JSONArray().put("born >= 1955"));
index.searchForFacetValues("series", "Peanutz", query, new AssertCompletionHandler() {
@Override
代码示例来源:origin: algolia/algoliasearch-client-android
@Test
public void deleteByQueryAsync() throws Exception {
addDummyObjects(3000);
final Query query = new Query().setNumericFilters(new JSONArray().put("dummy < 1500"));
index.deleteByQueryAsync(query, new AssertCompletionHandler() {
@Override
public void doRequestCompleted(JSONObject content, AlgoliaException error) {
if (error == null) {
index.browseAsync(query, new AssertCompletionHandler() {
@Override
public void doRequestCompleted(JSONObject content, AlgoliaException error) {
if (error == null) {
// There should not remain any object matching the query.
assertNotNull(content.optJSONArray("hits"));
assertEquals(content.optJSONArray("hits").length(), 0);
assertNull(content.optString("cursor", null));
} else {
fail(error.getMessage());
}
}
});
} else {
fail(error.getMessage());
}
}
});
}
代码示例来源:origin: algolia/algoliasearch-client-android
@Test
public void deleteByAsync() throws Exception {
addDummyObjects(3000);
final Query query = new Query().setNumericFilters(new JSONArray().put("dummy < 1500"));
index.deleteByAsync(query, new AssertCompletionHandler() {
@Override
代码示例来源:origin: algolia/algoliasearch-client-android
@Test
public void numericFilters() throws JSONException {
final JSONArray VALUE = new JSONArray("[\"code=1\", [\"price:0 to 10\", \"price:1000 to 2000\"]]");
Query query = new Query();
assertNull(query.getNumericFilters());
query.setNumericFilters(VALUE);
assertEquals(VALUE, query.getNumericFilters());
assertEquals("[\"code=1\",[\"price:0 to 10\",\"price:1000 to 2000\"]]", query.get("numericFilters"));
assertEquals(query.getNumericFilters(), Query.parse(query.build()).getNumericFilters());
}
内容来源于网络,如有侵权,请联系作者删除!