我想 运行 在 solr 中查询具有特殊字符 & 和 %
I want to run a query in solr having the special character & and %
当 & 和 % 出现在查询中时,我遇到问题 运行 使用 Pysolr 的查询。其余的特殊字符可以使用 '\' 处理,但 '&' 和 '%' 是不同的情况。以下查询发送错误,但是当 & 和 % 被删除时它工作正常。有人可以帮忙吗?
http:///1.254.254.254:8983solr/dovecottmail/select?fq=user:%22user@xyz.com%22&indent=on&wt=python&q="https://aws.amazon.com/marketplace/pp/b074m84rjm\%qid=1507365354908\&\;sr=0-1\&\;ref_=srh_res_product_title"
您可以在传递给 solr 时对查询参数进行编码。
请看下面的例子。
http://1.254.254.254:8983:solr/dovecottmail/select?fq=user:%22user@xyz.com%22&indent=on&wt=python&q=%22https%3A%2F%2Faws.amazon.com%2Fmarketplace%2Fpp%2Fb074m84rjm%5C%25qid%3D1507365354908%5C%26amp%5C%3Bsr%3D0-1%5C%26amp%5C%3Bref_%3Dsrh_res_product_title%22
它会适合你...
当 & 和 % 出现在查询中时,我遇到问题 运行 使用 Pysolr 的查询。其余的特殊字符可以使用 '\' 处理,但 '&' 和 '%' 是不同的情况。以下查询发送错误,但是当 & 和 % 被删除时它工作正常。有人可以帮忙吗?
http:///1.254.254.254:8983solr/dovecottmail/select?fq=user:%22user@xyz.com%22&indent=on&wt=python&q="https://aws.amazon.com/marketplace/pp/b074m84rjm\%qid=1507365354908\&\;sr=0-1\&\;ref_=srh_res_product_title"
您可以在传递给 solr 时对查询参数进行编码。
请看下面的例子。
http://1.254.254.254:8983:solr/dovecottmail/select?fq=user:%22user@xyz.com%22&indent=on&wt=python&q=%22https%3A%2F%2Faws.amazon.com%2Fmarketplace%2Fpp%2Fb074m84rjm%5C%25qid%3D1507365354908%5C%26amp%5C%3Bsr%3D0-1%5C%26amp%5C%3Bref_%3Dsrh_res_product_title%22
它会适合你...