Pysolr使用AND连接多个查询。

huangapple go评论101阅读模式
英文:

Pysolr search multiple queries with and

问题

如何搜索多个查询并需要&q.op中的“and”?

import pysolr
solr = pysolr.Solr('..url../solr/'+name, always_commit=True)
solr.search('test:test AND url:http://test.com')

我想要在"AND" q.op参数中添加对"url:http://test.com"的搜索。

英文:

How to search multiple queries and require the "and" for q.op?

import pysolr
solr = pysolr.Solr('..url../solr/'+name,always_commit=True)
solr.search("test:test")

I want to add searching for also "url:http://test.com" as an "AND" q.op parameter.

答案1

得分: 0

我将很快测试这个,但目前看起来像是:

solr.search("test:'test'\nurl:'http://test.com'", {
    'q.op':'AND'
})
英文:

I will test this soon, but currently it looks like:

solr.search("test:'test'\nurl:'http://test.com'",**{
    'q.op':'AND'
})

huangapple
  • 本文由 发表于 2023年2月27日 08:22:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/75575865.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定