English 中文(简体)
Zend 搜索多周期查询时没有点击吗? (应该有 3)
原标题:No hits with from a Zend Search MultiTerm Query? (There should be 3)

我有一个搜索表格, 上面有名字、 俱乐部、 高级、 双级和俱乐部字段。 我从选择框中选择了一个俱乐部, 将名称字段留空并点击搜索 。 结果没有点击 。 数据库里有3个记录, 是被选中的俱乐部的一部分 。 为什么?

xx(xx).(xx).(xx).(xx).(xx).(xx).).(xx(x).).(xx(x).).(xx(x).).).(x(x).).(x(x).).(x(x).).(x(x).).(x(x).).(x(x).).(x(x).).(x.).(x(x).).(x(x.).(x.).(x.).(x.).(x.).(x(x.).(x.).(x.).(x(x)。

主计长级别 :

$search = $this->get( ewz_search.lucene );

// Create query
$terms = array(new Term($form->getData()->getName(),  name ),
    new Term($form->getData()->getClub(),  club ),
    new Term($form->getData()->getNatRanking(),  natranking ),
    new Term($form->getData()->getNatDoublesRanking(),  doublesranking )
);
$signs = array(TRUE, TRUE, TRUE, TRUE);
$query = new MultiTerm($terms, $signs);

// Get results 
$results = $search->find($query);

// Echo prints: "+name: +club:A.R.A. LA GANTOISE +natranking: +doublesranking:"
echo $query;

// This returns 0
die("debug: " . count($results);

//评价

这工作(给我3个结果):

$manual_query = "+name: +club:A.R.A. LA GANTOISE +natranking: +doublesranking:";
最佳回答

I casted the Multiterm object to a string and now it works. That s strange as the example in the docs clearly show that it should work without casting it to a string:

(http://framework.zend.com/manual/en/zend.search.lucene.query-api.html#zend.search.lucene.queries.multerm-query)

$query = new Zend_Search_Lucene_Search_Query_MultiTerm();

$query->addTerm(new Zend_Search_Lucene_Index_Term( word1 ), true);
$query->addTerm(new Zend_Search_Lucene_Index_Term( word2 ,  author ),
            null);
$query->addTerm(new Zend_Search_Lucene_Index_Term( word3 ), false);

$hits  = $index->find($query);
问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签