小编emr*_*cer的帖子

如何在Apache Solr查询中使用OR值?

为我解决这个问题的最后一个选择是问StackOverflow.

我正在尝试创建一个Solr查询来获取在其中一个字段上具有特定值的文档或没有值的文档...

理论上,这个查询应该有效.

以下是一些信息:

查询:(姓名:约翰) - >结果数:15383 //约翰斯

查询:(名称:{*TO*}) - >结果数:61013 //具有名称的人

查询: - (名称:{*TO*}) - >结果数:216888 //没有名字的人

现在,当我在使用OR运算符的同一查询中使用第一个和第三个查询时,我希望得到(216888 + 15383)个结果.但是SOLR给出了15383个结果,只是忽略了第三个查询的效果:

查询: +((name:john)( - (name:{*TO*})))//这是我使用过的查询.

这是Solr的错误还是我在查询中做错了?合并两个查询结果是一个额外的解决方案,但如果我可以使用简单的查询,我不想做额外的代码实现.

任何帮助,将不胜感激.

solr sql-null

12
推荐指数
1
解决办法
1万
查看次数

仅使用 Nginx 重写从根目录中的 URL 中删除 index.php

我使用 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)

wordpress seo nginx url-rewriting ipb

6
推荐指数
1
解决办法
2万
查看次数

如果 nginx 上存在查询参数,则重定向

我正在使用 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)

这里缺少什么?

forum redirect rewrite nginx ipb

6
推荐指数
1
解决办法
1万
查看次数

标签 统计

ipb ×2

nginx ×2

forum ×1

redirect ×1

rewrite ×1

seo ×1

solr ×1

sql-null ×1

url-rewriting ×1

wordpress ×1