我找不到一个更好的标题,我希望稍后如果可能的话在你的最终消遣中改变它.
我的问题:
我有一个音乐艺术家的数据库.这些看起来像这样:"dr.dre feat.ano","eminem&dr.dre","dr.dre feat.ll cool j","dr.dre","dr.dre feat.eminem&skylar grey" .我们只有两个字段:id和name.
在默认模式solr核心上,我运行此查询:"q = dr.dre",结果还可以,但不完美,如下所示:
请注意,他们得到了完全相同的分数.
我想要的是将"dr.dre"作为第一个结果,然后是所有其他结果,如下所示:
我该如何实现这一目标?(过滤器,标记器,复制字段等等并不重要.我无法更改solr中的代码,因为我在其他论坛上看到过建议)
谢谢.
我有一个带有索引操作的控制器,我在其中使用重定向来路由:
$this->redirect()->toRoute('dummy-route')->setStatusCode('301');
Run Code Online (Sandbox Code Playgroud)
这适用于我的本地开发机器,但是一旦我将其部署到暂存,重定向就不再起作用了.我设置了一个标题('Location:'),只是为了查看重定向是否正常工作,它确实按预期工作.
什么可以使zf2重定向在第二台机器上不起作用?
@ noobie-php是的,这是代码:
public function indexAction()
{
$this->redirect()->toRoute('base-calculator')->setStatusCode('301');
exit;
}
Run Code Online (Sandbox Code Playgroud)
和路线:
'application' => array(
'type' => 'Literal',
'options' => array(
'route' => '/application',
'defaults' => array(
'__NAMESPACE__' => 'Application\Controller',
'controller' => 'Index',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'default' => array(
'type' => 'Segment',
'options' => array(
'route' => '/[:controller[/:action]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
),
),
),
),
),
'base-calculator' => array(
'type' …
Run Code Online (Sandbox Code Playgroud)