为我解决这个问题的最后一个选择是问StackOverflow.
我正在尝试创建一个Solr查询来获取在其中一个字段上具有特定值的文档或没有值的文档...
理论上,这个查询应该有效.
以下是一些信息:
查询:(姓名:约翰) - >结果数:15383 //约翰斯
查询:(名称:{*TO*}) - >结果数:61013 //具有名称的人
查询: - (名称:{*TO*}) - >结果数:216888 //没有名字的人
现在,当我在使用OR运算符的同一查询中使用第一个和第三个查询时,我希望得到(216888 + 15383)个结果.但是SOLR给出了15383个结果,只是忽略了第三个查询的效果:
查询: +((name:john)( - (name:{*TO*})))//这是我使用过的查询.
这是Solr的错误还是我在查询中做错了?合并两个查询结果是一个额外的解决方案,但如果我可以使用简单的查询,我不想做额外的代码实现.
任何帮助,将不胜感激.
我使用 Wordpress 作为网站的根目录,使用 Invision Power Boards 作为论坛。
http://localhost -> Wordpress
http://localhost/forum -> IPB
Run Code Online (Sandbox Code Playgroud)
我已经使用 Nginx-rewrite 成功从 WordPress URL 中删除了“index.php”,但是当我尝试在 IPB 上使用 SEO 友好 URL 时,nginx 只是返回到 Wordpress 的 404 页面。
我的配置是这样的:
#This removes "index.php" from Wordpress URLs
location / {
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?q=$uri&$args;
}
Run Code Online (Sandbox Code Playgroud)
然后我按照此链接修改我的 nginx conf 文件,以便能够使用 IPB 的 SEO 友好 URL:http ://www.devcu.com/forums/topic/262-furl-Friendly-urls-with-ipb-和-nginx/
#This part is to be able to use IPB SEO
location /forum/ {
index index.php;
try_files $uri $uri/ /forum/index.php?$uri&$args;
rewrite …Run Code Online (Sandbox Code Playgroud) 我正在使用 IPB 论坛。我设法使用友好的 url 和 nginx 服务器配置修改。但是,我需要将旧论坛的 URL 重定向到重定向器 php 文件以获取主题(或论坛、成员等)的当前 URL。例如:如果 url 是 like /forum/index.php?board=23,我将重定向到 redirector.php 。
这是我当前能够在 IPB 上使用友好 URL 的配置
location /forum {
try_files $uri $uri/ /forum/index.php;
rewrite ^ /forum/index.php? last;
}
Run Code Online (Sandbox Code Playgroud)
当我在这个位置块中插入一个 if 语句时,如下所示,我无法检索查询参数“board”。
location /forum {
if ($arg_board != "") {
rewrite ^ /redirector.php?q=$arg_board break;
}
try_files $uri $uri/ /forum/index.php;
rewrite ^ /forum/index.php? last;
}
Run Code Online (Sandbox Code Playgroud)
这里缺少什么?