本文整理汇总了Python中seo_pysolr.Solr._from_python方法的典型用法代码示例。如果您正苦于以下问题:Python Solr._from_python方法的具体用法?Python Solr._from_python怎么用?Python Solr._from_python使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类seo_pysolr.Solr
的用法示例。
在下文中一共展示了Solr._from_python方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: DESolrSearchBackend
# 需要导入模块: from seo_pysolr import Solr [as 别名]
# 或者: from seo_pysolr.Solr import _from_python [as 别名]
#.........这里部分代码省略.........
kwargs['sort'] = sort_by
if bf is not None:
kwargs['bf'] = bf
if start_offset is not None:
kwargs['start'] = start_offset
if end_offset is not None:
kwargs['rows'] = end_offset - start_offset
if highlight is True:
kwargs['hl'] = 'true'
kwargs['hl.fragsize'] = '100'
kwargs['hl.snippets'] = '2'
kwargs['hl.mergeContiguous'] = 'true'
kwargs['hl.simple.pre'] = '<b>'
kwargs['hl.simple.post'] = '</b>'
if self.include_spelling is True:
kwargs['spellcheck'] = 'true'
kwargs['spellcheck.collate'] = 'true'
kwargs['spellcheck.count'] = 1
if spelling_query:
kwargs['spellcheck.q'] = spelling_query
if facets is not None:
kwargs['facet'] = 'on'
kwargs['facet.field'] = facets.keys()
for facet_field, options in facets.items():
for key, value in options.items():
kwargs['f.%s.facet.%s' % (facet_field, key)] = self.conn._from_python(value)
if facet_mincount is not None:
kwargs['facet'] = 'on'
kwargs['facet.mincount'] = facet_mincount
if facet_limit is not None:
kwargs['facet'] = 'on'
kwargs['facet.limit'] = facet_limit
if facet_prefix is not None:
kwargs['facet'] = 'on'
kwargs['facet.prefix'] = facet_prefix
if facet_sort is not None:
kwargs['facet'] = 'on'
kwargs['facet.sort'] = facet_sort
if facet_offset is not None:
kwargs['facet'] = 'on'
kwargs['facet.offset'] = facet_offset
if date_facets is not None:
kwargs['facet'] = 'on'
kwargs['facet.date'] = date_facets.keys()
kwargs['facet.date.other'] = 'none'
for key, value in date_facets.items():
kwargs["f.%s.facet.date.start" % key] = self.conn._from_python(value.get('start_date'))
kwargs["f.%s.facet.date.end" % key] = self.conn._from_python(value.get('end_date'))
gap_by_string = value.get('gap_by').upper()
gap_string = "%d%s" % (value.get('gap_amount'), gap_by_string)