本文整理汇总了PHP中search::doSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP search::doSearch方法的具体用法?PHP search::doSearch怎么用?PHP search::doSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类search
的用法示例。
在下文中一共展示了search::doSearch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getObjectPoolBySolrQuery
static function getObjectPoolBySolrQuery($solr_query = null)
{
include_once drupal_get_path('module', 'apiary_project') . '/workflow/include/search.php';
$solr_search = new search();
$specimen_list = array();
if (strpos(strtolower($solr_query), 'q=') > -1) {
} else {
$solr_query = 'q=' . $solr_query;
}
if (strpos(strtolower($solr_query), '&rows=') > -1) {
} else {
$solr_query .= '&rows=10000';
}
$solr_results = $solr_search->doSearch($solr_query);
if ($solr_results != false) {
$solr_sxml = new SimpleXMLElement($solr_results);
foreach ($solr_sxml->result[0]->doc as $doc) {
foreach ($doc->children() as $sxml_node) {
$node_value = (string) $sxml_node;
if (strpos($node_value, 'ap-specimen:') > -1) {
if (!array_search($node_value, $specimen_list)) {
array_push($specimen_list, $node_value);
}
}
}
}
}
return $specimen_list;
}
示例2: solr_query_xml
function solr_query_xml($q, $fl = '', $op = '', $rows = '')
{
$solr_search = new search();
if (strpos($q, "q=") === false) {
$q = 'q=' . str_replace('&', '', $q);
}
$solr_query = $q;
if (!empty($fl)) {
if (strpos($fl, 'fl=') === false) {
$fl = 'fl=' . $fl;
}
$solr_query .= '&' . str_replace('&', '', $fl);
}
if (!empty($op)) {
if (strpos($op, 'op=') === false) {
$op = 'op=' . $op;
}
$solr_query .= '&' . str_replace('&', '', $op);
}
if (!empty($rows)) {
if (strpos($rows, 'rows=') === false) {
$rows = 'rows=' . $rows;
}
$solr_query .= '&' . str_replace('&', '', $rows);
}
//echo "solr_query = ".$solr_query."<br>\n";
$solr_results = $solr_search->doSearch($solr_query);
if ($solr_results != false) {
$solr_sxml = new SimpleXMLElement($solr_results);
return $solr_sxml;
} else {
return false;
}
}
示例3: search
<?php
switch ($_POST['action']) {
case 'search':
$search = new search($_POST['values']['needle']);
$search->doSearch();
echo json_encode(array('result' => $search->result));
break;
}
示例4: solr_query_search
function solr_query_search($q, $fl = '', $op = '', $rows = '')
{
$solr_search = new search();
if (strpos($q, "q=") === false) {
$q = 'q=' . str_replace('&', '', $q);
}
$solr_query = $q;
if (!empty($fl)) {
if (strpos($fl, 'fl=') === false) {
$fl = 'fl=' . $fl;
}
$solr_query .= '&' . str_replace('&', '', $fl);
}
if (!empty($op)) {
if (strpos($op, 'op=') === false) {
$op = 'op=' . $op;
}
$solr_query .= '&' . str_replace('&', '', $op);
}
if (!empty($rows)) {
if (strpos($rows, 'rows=') === false) {
$rows = 'rows=' . $rows;
}
$solr_query .= '&' . str_replace('&', '', $rows);
}
//echo "solr_query = ".$solr_query."<br>\n";
return $solr_search->doSearch($solr_query);
}