File: test.xml

package info (click to toggle)
sphinxsearch 2.2.11-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 25,720 kB
  • sloc: cpp: 102,259; xml: 85,608; sh: 9,259; php: 3,790; ansic: 3,158; yacc: 1,969; java: 1,336; ruby: 1,289; python: 1,062; pascal: 912; perl: 381; lex: 275; makefile: 150; sql: 77; cs: 35
file content (151 lines) | stat: -rw-r--r-- 2,920 bytes parent folder | download | duplicates (4)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<test>
<name>quorum vs decreased matched word</name>

<config>
indexer
{
	mem_limit = 16M
}

searchd
{
	<searchd_settings/>
}

source test1
{
	type = mysql
	<sql_settings/>
	sql_query = SELECT * FROM test_table1
}

index test1
{
	source	= test1
	path	= <data_path/>/test1
	docinfo	= extern
}

source test2
{
	type = mysql
	<sql_settings/>
	sql_query = SELECT * FROM test_table2
}

index test2
{
	source	= test2
	path	= <data_path/>/test2
	docinfo	= extern
}

source test_kw
{
	type					= mysql
	<sql_settings/>

	sql_query				= select 1 id, 'of me' text, 11 idd UNION select 2 id, 'of me' text, 11 idd UNION select 3 id, 'of me' text, 11 idd UNION select 4 id, 'of me' text, 11 idd
	sql_joined_field		= text from query; select id , text from test_kw_joined
	sql_attr_uint			= idd
}

index test_kw
{
	source	= test_kw
	path	= <data_path/>/test_kw

	docinfo					= extern
	dict = keywords
}
</config>

<db_create>
CREATE TABLE test_table1
(
	document_id INT NOT NULL,
	text VARCHAR(255) NOT NULL
);
</db_create>

<db_drop>
DROP TABLE IF EXISTS test_table1;
</db_drop>

<db_create>
CREATE TABLE test_table2
(
	document_id INT NOT NULL,
	text VARCHAR(255) NOT NULL
);
</db_create>

<db_drop>
DROP TABLE IF EXISTS test_table2;
</db_drop>

<db_create>
create table test_kw_joined
(
	id int,
	text text (4096000) not null
) ENGINE=MYISAM
</db_create>
<db_drop>drop table if exists test_kw_joined</db_drop>

<custom_insert><![CDATA[
	$sql_data = array (
		1=>'world space',
		2=>'one',
		3=>'two',
		4=>'world',
		5=>'space',
		6=>'unused1',
		7=>'unused2'
		);
	foreach ( $sql_data as $key => $value )
	{
		$text = sprintf ( "insert into test_table1 values ( %d, '%s' )", $key, $value );
		mysql_query ( $text );
	}
	
	$text = sprintf ( "insert into test_table2 values ( 1, '%s' )", $sql_data[1] );
	for ( $i=1; $i < 513; $i++ )
	{
		$text = '';
		$text = sprintf ( "insert into test_table2 values ( %d, '%s' )", $i, $sql_data[1] );
		mysql_query ( $text );
	}
	foreach ( $sql_data as $key => $value )
	{
		$text = sprintf ( "insert into test_table2 values ( %d, '%s' )", 600+$key, $value );
		mysql_query ( $text );
	}
	
	for ( $i=1; $i<=4; $i++ )
	{
		$text = '';
		$iend = 300000;
		if ( $i==4 )
			$iend = 150000;
		for ( $j=0; $j<$iend; $j++ )
		{
			$text .= 'v ';
		}
		if ( $i==4 )
			$text .= ' the box';
		mysql_query ( " insert into test_kw_joined values ( $i, '$text' ) " ) or die( "$i:" . mysql_error() );
	}
]]></custom_insert>

<queries>
	<query mode="extended2" index="test1">"one two unused1 unused2 space world"/2</query>
	<query mode="extended2" index="test2" limits="600">"one two unused1 unused2 space world"/2</query>
	<!-- regression index missed tail of joined hits -->
	<query mode="extended2" index="test_kw" ></query>
	<query mode="extended2" index="test_kw" >of</query>
	<query mode="extended2" index="test_kw" >the box</query>
	<query mode="extended2" index="test_kw" >v</query>
</queries>

</test>