我需要另一个PARAM“类型”添加到我的查询与Django ElasticSearch/pyes:如何使用两个过滤器进行搜索?
过滤这是我现在所拥有的,它为我的作品:
conn = pyes.ES(settings.ES_URL)
query_string = self.request.GET['q'].lower()
type = self.request.GET['type'].lower()#not used yet!
...
query1 = pyes.MultiMatchQuery(self.FIELDS_SEARCH, query_string, operator='and')
search1 = pyes.Search(query=query1, filter=filters, fields=self.RESPONSE_FIELDS, size=num, index_boost=1)
response = conn.search_multi([search1, search2], indices_list=[es_alias] * 2, doc_types_list=['asset', 'people'] * 2)
response._do_search()
我怎样才能通过PARAM添加过滤“型“?
你在说'_type'吗?或者是在你的索引中键入一个字段? – ChintanShah25
类型是一个参数我想过滤'type = self.request.GET ['type']' – Armance
相同query_string – Armance