我将参数设置为数组,如http://jmsyst.com/libs/serializer/master/reference/annotations中所述
class QuestionAnswer
{
/**
* @JMS\Type("ArrayCollection<Rest\Bundle\Entity\Fixture\QuestionOptions>")
* @Groups({"QuestionAnswer"})
*/
public $question_options_array ;
}
Run Code Online (Sandbox Code Playgroud)
并在另一个类中定义一些选项
class QuestionOptions
{
/**
* @JMS\Type("integer")
* @Groups({"get_option"})
*/
public $question_option_id ;
/**
* @JMS\Type("string")
* @Groups({"post_option"})
*/
public $question_option_description;
}
Run Code Online (Sandbox Code Playgroud)
在@ApiDoc我定义
* input={
* "class" = "Rest\BeautyBundle\Entity\Fixture\ProfileQuestionAnswer",
* "groups"={"QuestionAnswer", "get_option"},
* },
Run Code Online (Sandbox Code Playgroud)
在更新之前它运作良好.但composer update只有"QuestionAnswer"组名称起作用后才能显示QuestionOptions类的所有属性.如何以更新前的方式提交数组中的属性?
抓取我的网站时遇到问题...有一个带有两个下拉列表的表单....当我开始抓取时,抓取工具只从表单中获取部分链接....从第一个下拉列表中从第二个下拉列表中选择部分选项....我尝试在nutch-defaults.xml文件中更改一些配置,但一切都是相同的......
I change
fetcher.threads.per.queue 1 - 10
db.ignore.internal.links true - false
db.ignore.external.links false - true
http.content.limit 65536 - 65536000
file.content.limit 65536 - 65536000
db.update.max.inlinks 10.000 - 100.000
Run Code Online (Sandbox Code Playgroud)
有没有其他选择,可以帮助我抓取我的表格中的所有选项...... ?? 谢谢你的回答.
我使用PHP Solr扩展,当我运行下面的代码时,我得到异常:
致命错误:未捕获的异常'SolrClientException',消息'不成功的查询请求:响应代码404.
我不明白,有什么不对,我也成功使用了Solr客户端.
include "bootstrap.php";
$options = array
(
'hostname' => SOLR_SERVER_HOSTNAME,
'login' => SOLR_SERVER_USERNAME,
'password' => SOLR_SERVER_PASSWORD,
'port' => SOLR_SERVER_PORT,
);
$client = new SolrClient($options);
$query = new SolrQuery();
$query->setQuery('lucene');
$query->setStart(0);
$query->setRows(50);
$query->addField('cat')->addField('features')->addField('id')-> addField('timestamp');
$query_response = $client->query($query);
$response = $query_response->getResponse();
print_r($response);
?>
Run Code Online (Sandbox Code Playgroud)
我的bootstrap.php文件是:
<?php
/* Domain name of the Solr server */
//define('SOLR_SERVER_HOSTNAME', 'solr.example.com');//solr.example.com
define('SOLR_SERVER_HOSTNAME', 'localhost');//solr.example.com
define('SOLR_SECURE', true);
/* HTTP Port to connection */
//define('SOLR_SERVER_PORT', ((SOLR_SECURE) ? 8443 : 8983));
define('SOLR_SERVER_PORT', ((SOLR_SECURE) ? 8080 : 8443)); …Run Code Online (Sandbox Code Playgroud)