当q = 时,Solr返回所有结果(Solr return all results when q=)
我正在使用PHP Codeigniter框架和solr-php-client来构建搜索应用程序。
我有两页 -
- 只有一个输入框的搜索页面
- 结果页面,当用户在搜索页面中输入搜索词时,将显示结果
问题是,除非我输入一个搜索词, solr-php-client没有返回任何结果,而且url只是
"http://localhost:8080/search/?q="
,它不会做任何事情。 但是当我输入一个搜索词,例如“apple”作为例如,它会重定向到结果页面而没有任何问题,并且网址变为"http://localhost:8080/rdsearch/?q=apple"
我想要实现的是 - 当用户未在搜索页面中输入搜索词或q为空时,如
"http://localhost:8080/search/?q="
,它应该直接指向结果页面并显示所有结果(类似于solr查询*:*
)I am using PHP Codeigniter framework with solr-php-client to build a search application.
I have two pages -
- a search page with just a single input box
- a results page which will display results when user enters a search term in search page
The issue is, unless I enter a search term solr-php-client is not returning any results and for which the url would just be
"http://localhost:8080/search/?q="
and it wont do anything. But when I enter a search term such as "apple" as an eg., it redirect to results page with matching results without any issue and the url becomes"http://localhost:8080/rdsearch/?q=apple"
What I would like to achieve is - When user does not enter a search term in the search page or when q is empty as in
"http://localhost:8080/search/?q="
, it should simply direct to results page and show all the results (similar to a solr query*:*
)
原文:https://stackoverflow.com/questions/21272577
最满意答案
TorCtl
控制Tor; 您仍然需要配置urllib
以使用代理。 阅读文档 ; 您可能更喜欢在[, proxies]
为您的情况设置环境变量。以下是如何使用
proxies
:proxies = {'http': 'http://localhost:9050/'} ip = urllib.urlopen('http://hypersource.net78.net/autos/ip.php', proxies=proxies).read()
如果您正在使用任何其他协议(例如,HTTPS),请在
proxies
指定它。
TorCtl
controls Tor; you still need to configureurllib
to use a proxy. Read the documentation; you might prefer just setting environment variables over[, proxies]
for your situation.Here’s how to use
proxies
, though:proxies = {'http': 'http://localhost:9050/'} ip = urllib.urlopen('http://hypersource.net78.net/autos/ip.php', proxies=proxies).read()
If you’re using any other protocol (for example, HTTPS), specify that in
proxies
too.
相关问答
更多-
如何使用tor?[2024-01-17]
tor官网已经不能直接打开了16楼下的应该是linux的或源码包,win下要下exe的。 -
匿名解释了这个套接字覆盖,答案几乎完美,除非你必须关闭控制套接字 。 由于TorCtl事件循环会更安全,但我必须深入了解TorCtl代码以了解此事件循环。 总结你的代码变成: from TorCtl import TorCtl import socks import socket socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5, "127.0.0.1", 9050) import urllib2 import sqlite3 from BeautifulSou ...
-
我删除了SSL和FTP代理和端口设置,它工作正常。 我还使用了端口9150。 这是工作代码: import stem.process from stem import Signal from stem.control import Controller from splinter import Browser proxyIP = "127.0.0.1" proxyPort = 9150 proxy_settings = {"network.proxy.type":1, "network.prox ...
-
由于垃圾邮件发送者的滥用,许多Tor出口节点拒绝发送端口25(SMTP)流量,因此您可能会遇到问题。 Because of abuse by spammers, many Tor egress nodes decline to emit port 25 (SMTP) traffic, so you may have problems.
-
连接到TOR Java(Connection to TOR Java)[2023-06-19]
问题非常简单,当您使用silvertunnel API时,您不需要在URL中指定协议,因此只需删除http://修复错误。 尝试以下方法 //remove http:// String remoteHostname = "test.silvertunnel.com"; The problem is quite simple, when you use the silvertunnel API you dont need to specify the p ... -
TorCtl控制Tor; 您仍然需要配置urllib以使用代理。 阅读文档 ; 您可能更喜欢在[, proxies]为您的情况设置环境变量。 以下是如何使用proxies : proxies = {'http': 'http://localhost:9050/'} ip = urllib.urlopen('http://hypersource.net78.net/autos/ip.php', proxies=proxies).read() 如果您正在使用任何其他协议(例如,HTTPS),请在proxies ...
-
使用Tor和Meteor DDP(Using Tor and Meteor DDP)[2023-09-04]
我在完成Meteor之后导入Communicator解决了这个问题,就在我在Communicator中调用方法之前。 from MeteorClient import MeteorClient client = MeteorClient('ws://127.0.0.1:3000/websocket') client.connect() def subscription_callback(error): if error: print(error) client.subscrib ... -
你没有犯错。 该输出表明Tor已启动,已连接到网络并正在运行。 你可能想知道如何守护它,或者在后台运行它( nohup tor & )。 Opening Socks listener on 127.0.0.1:9050行告诉您它的SOCKS(代理)端口正在侦听端口9050.这是您想要curl或wget等应用程序代理的端口。 如您链接的文章所示,您只需使用Tor的SOCKS端口运行curl。 curl -s —socks5-hostname 127.0.0.1:9050 http://www.showmyip ...
-
TorCtl连接拒绝错误(TorCtl connection refused error)[2022-05-06]
我想你应该这样做 conn.send_signal("NEWNYM") 您可以尝试在通话之间打印conn。 看看它是否是无。 也许连接失败了。 I think you should do conn.send_signal("NEWNYM") You could try printing conn in between the calls. See if it's None. Maybe the connection failed. -
答案: 首先,打开Tor浏览器(它需要已经运行)。 然后,在您的代码中,确保只需从以下开始: Selenium::WebDriver::Firefox::Binary.path='{location of start_tor_browser*}' browser = Watir::Browser.new :firefox *在我的情况下:/ home / tor / tor-browser_en-US / start-tor-browser 不需要其他任何东西 - 不要打扰乱码 The answer: F ...