Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何更改此solr查询_Solr - Fatal编程技术网

如何更改此solr查询

如何更改此solr查询,solr,Solr,下面是我在用户键入某个字符时对solr的查询示例I http://localhost:8983/solr/db/select?q=(name:I*) OR (lastname: I*) OR (midname:I*)&fl=name, midname,lastname&rows=5&wt=json&indent=true&group=true&group.field=lastname&group.ngroups=true"; 我应该如何将

下面是我在用户键入某个字符时对solr的查询示例I

http://localhost:8983/solr/db/select?q=(name:I*) OR (lastname: I*) OR (midname:I*)&fl=name, midname,lastname&rows=5&wt=json&indent=true&group=true&group.field=lastname&group.ngroups=true";
我应该如何将查询更改为solr以便我可以得到

  • 首先,那些名字和姓氏以这个字符开头的人

  • 如果没有第二个,那些只有名字以这个字符开头的人

  • 如果没有-第三-那些只有姓以这个字符开头的人

  • 如果没有-那些中间名以I开头的


  • 除非您正在编写自定义搜索组件或根据以前的查询结果再次触发查询,否则无法检查0结果

    对于排序,您可以增强查询部分,以便匹配条件

    例如
    (名称:I*)^10或(姓氏:I*)^5或(中间名:I*)^1