1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
<?xml version="1.0" encoding="utf-8"?>
<test>
<name>snippets vs NEAR</name>
<config>
searchd
{
<searchd_settings/>
}
source test
{
type = mysql
<sql_settings/>
sql_query = SELECT 1, 'text';
}
index test
{
source = test
path = <data_path/>/test
}
index test_stops
{
source = test
path = <data_path/>/test_stops
stopwords = stopwords.txt
}
</config>
<db_insert>select 1;</db_insert>
<custom_test><![CDATA[
$results = array();
$docs = array( 'Was one rabiit. Now there are five rabbits.' );
$opts = array( 'query_mode'=>true, "around"=> 2 );
$results[] = $client->BuildExcerpts($docs, 'test', '(one) NEAR/35 ("five")', $opts );
// regression crash on 0 docs snippet
$results[] = $client->BuildExcerpts(array(), 'test', '(one) NEAR/35 ("five")', $opts );
$results[] = $client->GetLastError();
// regression for snippets vs stopwords vs proximity
$docs = array( 'A section of dome lifted up' );
$results[] = $client->BuildExcerpts($docs, 'test_stops', '"section of dome"~5', $opts );
$results[] = $client->BuildExcerpts($docs, 'test_stops', '"section of dome"~5', array( 'query_mode'=>true, 'exact_phrase'=>true ) );
]]></custom_test>
</test>
|