0

再会,

首先,我对 solr 很陌生。

我正在使用 solr 6.6.6、python 3.7 和 pysolr(最新版本)。

我有许多具有以下格式的文档:

pysolr.add({
  'first_name': 'Jane',
  'last_name': 'Doe',
  'contact': {
    'phone_number': '0678901122',
    'address': 'near the fire place'
  }
})

我阅读了yonik.commediumlucidwork上的一些文档,以了解如何对 solr 进行查询。

我已经尝试过以下方法:

pysolr.search('contact.phone_number:06')

显然,这很糟糕,并给了我错误:[Reason: undefined field contact.zip_code]

在上面的示例中,我想了解如何从子元素联系人中检索值。

4

0 回答 0