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 (86 lines) | stat: -rw-r--r-- 3,863 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
<?xml version="1.0" encoding="utf-8"?>
<test>

<name>ranker internals (PACKEDFACTORS(), different IDF variants, etc)</name>

<config>
indexer
{
	mem_limit		= 16M
}

searchd
{
	<searchd_settings/>
}

source test
{
	type			= mysql
	<sql_settings/>
	sql_query		= select * from test_table
	sql_attr_uint	= gid
}

index test
{
	source			= test
	path			= <data_path/>/test
	index_field_lengths	= 1
}

index test_stop
{
	source			= test
	path			= <data_path/>/test_stop
	stopwords = stopwords.txt
}
</config>

<db_create>
CREATE TABLE test_table
(
	id INTEGER PRIMARY KEY NOT NULL,
	gid INTEGER NOT NULL,
	title VARCHAR(255) NOT NULL
);
</db_create>
<db_drop>DROP TABLE IF EXISTS test_table;</db_drop>
<db_insert>INSERT INTO test_table VALUES
( 1, 123, 'THE document collection. Aiming for exactly 10 docs.' ),
( 2, 123, 'the idftest2' ),
( 3, 123, 'the idftest2 and idftest1' ),
( 4, 123, 'the' ),
( 5, 123, 'the' ),
( 6, 123, 'the' ),
( 7, 123, 'the' ),
( 8, 123, 'the' ),
( 9, 123, 'the' ),
( 10, 123, 'the' )
</db_insert>

<sphqueries>
<sphinxql>select *, weight(), packedfactors() from test where match('the') option ranker=expr('1000000+1000000*sum(sum_idf)')</sphinxql>
<sphinxql>select *, weight(), packedfactors() from test where match('the') option idf=plain, ranker=expr('1000000+1000000*sum(sum_idf)')</sphinxql>
<sphinxql>select *, weight(), packedfactors() from test where match('idftest1') option idf=normalized, ranker=expr('1000000+1000000*sum(sum_idf)')</sphinxql>
<sphinxql>select *, weight(), packedfactors() from test where match('idftest1') option idf=plain, ranker=expr('1000000+1000000*sum(sum_idf)')</sphinxql>
<sphinxql>select *, weight(), packedfactors() from test where match('idftest1') option idf='plain,tfidf_unnormalized', ranker=expr('1000000+1000000*sum(sum_idf)')</sphinxql>
<sphinxql>select *, weight(), packedfactors() from test where match('idftest1 | fnord') option idf=normalized, ranker=expr('1000000+1000000*sum(sum_idf)')</sphinxql>
<sphinxql>select *, weight(), packedfactors() from test where match('idftest1 | fnord') option idf=plain, ranker=expr('1000000+1000000*sum(sum_idf)')</sphinxql>
<sphinxql>select *, weight(), packedfactors() from test where match('idftest1 | fnord') option idf='plain,tfidf_unnormalized', ranker=expr('1000000+1000000*sum(sum_idf)')</sphinxql>
<!-- regression heavy factors got enabed along with packedfactors -->
<sphinxql>select *, weight(), packedfactors() from test where match('idftest1 the') option idf='plain,tfidf_unnormalized', ranker=expr('1')</sphinxql>
<sphinxql>select *, weight(), packedfactors() from test where match('and idftest1 the') option idf='plain,tfidf_unnormalized', ranker=expr('1')</sphinxql>
<sphinxql>select *, weight(), packedfactors() from test where match('the idftest1') option idf='plain,tfidf_unnormalized', ranker=expr('1')</sphinxql>
<sphinxql>select *, weight(), packedfactors() from test where match('the and idftest1') option idf='plain,tfidf_unnormalized', ranker=expr('1')</sphinxql>

<!-- packedfactors with json output -->
<sphinxql>select *, weight(), factors({json=1}) from test where match('idftest1 the') option idf='plain,tfidf_unnormalized', ranker=expr('1')</sphinxql>
<sphinxql>select *, weight(), packedfactors({json=1}) from test where match('and idftest1 the')  option idf='plain,tfidf_unnormalized', ranker=expr('1')</sphinxql>
<sphinxql>select *, weight(), factors({json=1}) from test where match('the idftest1')  option idf='plain,tfidf_unnormalized', ranker=expr('1')</sphinxql>
<sphinxql>select *, weight(), packedfactors({json=1}) from test where match('the and idftest1')  option idf='plain,tfidf_unnormalized', ranker=expr('1')</sphinxql>
<sphinxql>select *, weight(), packedfactors({json=1}) from test_stop where match('the and idftest1')  option idf='plain,tfidf_unnormalized', ranker=expr('1')</sphinxql>

</sphqueries>

</test>