gpt4 book ai didi

android - 如何在 algolia 即时搜索中根据类别过滤命中

转载 作者:行者123 更新时间:2023-11-29 15:37:36 24 4
gpt4 key购买 nike

我想根据类别过滤匹配项,例如仅商店或咖啡。

这是我的查询:

  searcher.setQuery(new Query().setGetRankingInfo(true).setAroundLatLng(new AbstractQuery.LatLng(12.670913552202967, 78.6066235229373)).setAroundRadius(1000));

如何过滤我得到的结果?

最佳答案

看看Algolia's Filtering Guide ,您可以在其中了解过滤的工作原理。

对于Android客户端,您可以使用setFilters方法:

Query query = new Query("foo");
query.setFilters("category:coffee");

您可以在 client's documentation 中找到更多信息:

/**
* Filter the query with numeric, facet or/and tag filters.
* <p>
* The syntax is a SQL like syntax, you can use the OR and AND keywords. The syntax for the underlying numeric, facet and tag filters is the same than in the other filters:
* {@code available=1 AND (category:Book OR NOT category:Ebook) AND _tags:public date: 1441745506 TO 1441755506 AND inStock > 0 AND author:"John Doe"}
*
* @param filters a string following the given syntax.
* @return the {@link Query} for chaining.
*/
public @NonNull Query setFilters(String filters)

关于android - 如何在 algolia 即时搜索中根据类别过滤命中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46638628/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com