0

有没有办法根据分面字段的子字符串获取分面计数,类似于 EdgeNGram?


我正在使用 solr 以高精度存储 geohash 字符串,并希望以特定的 geohash 精度计算文档数。构面用于计算特定 geohash 'cell' 中的文档。

目前,我能看到的唯一方法是使用 geohashes 层。

例如。当前构面结果集(来自索引数据):

<lst name="facet_counts">
 <lst name="facet_fields">
  <int name="svztdm7w">11</int>
  <int name="sv87rzt8">3</int>
  <int name="sv83t6bf">2</int>
  <int name="syqxp43m">4</int>
  <int name="syr9f0v2">4</int>
  <int name="syp8p8hb">3</int>
  <int name="tuuttmtt">3</int>
  <int name="twj1ynm3">3</int>
  <int name="w30n6u71">3</int>
 </lst>
</lst>

我想要的精度 1 设置:

<int name="s">27</int>
<int name="t">6</int>
<int name="w">3</int>

我想要的精度 2 设置:

<int name="sv">16</int>
<int name="sy">11</int>
<int name="tu">3</int>
<int name="tw">3</int>
<int name="w3">3</int>

干杯。

4

1 回答 1

0

我在 Solr 中使用 geohashes 做了很多工作;我的最新作品是 LSP:http ://code.google.com/p/lucene-spatial-playground/ ,它有各种索引策略,包括 geohashes。如果你搜索我的名字和 geohash,你会发现各种材料。

听起来您所追求的本质上是基于 geohash 的热图。这是我的 LSP 待办事项列表中的一些内容,但与此同时,您可以通过对 geohashes 的索引方式进行一些操作来获得它。在对 geohash 进行边缘 n 语法化后,在 geohash 前面加上一个前导数字,即 geohash 的长度。例如,不仅仅是“16”,而是索引“216”。使用十六进制表示法,因此您可以在一个字符中获得 16 个值,而不是十进制的 10 个。分面时,使用 facet.prefix=2。

祝你好运并保持联系。

于 2012-01-10T15:30:54.233 回答