Skip to content

Commit 0d665d7

Browse files
committed
Account for backend changes in phrase search
1 parent d69a1cf commit 0d665d7

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/Query/HybridSearchQueryTests.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,51 +86,51 @@ FROM c
8686
WHERE FullTextContains(c.title, 'John') OR FullTextContains(c.text, 'John') OR FullTextContains(c.text, 'United States')
8787
ORDER BY RANK RRF(FullTextScore(c.title, ['John']), FullTextScore(c.text, ['United States']))",
8888
new List<List<int>>{
89-
new List<int>{ 61, 51, 49, 54, 75, 24, 77, 76, 80, 25, 22, 2, 66, 57, 85 },
90-
new List<int>{ 61, 51, 49, 54, 75, 24, 77, 76, 80, 25, 22, 2, 66, 85, 57 },
89+
new List<int>{ 61, 51, 49, 54, 75, 24, 77, 76, 80, 2, 22, 57, 85 },
90+
new List<int>{ 61, 51, 49, 54, 75, 24, 77, 76, 80, 2, 22, 85, 57 },
9191
}),
9292
MakeSanityTest(@"
9393
SELECT TOP 10 c.index AS Index, c.title AS Title, c.text AS Text
9494
FROM c
9595
WHERE FullTextContains(c.title, 'John') OR FullTextContains(c.text, 'John') OR FullTextContains(c.text, 'United States')
9696
ORDER BY RANK RRF(FullTextScore(c.title, ['John']), FullTextScore(c.text, ['United States']))",
97-
new List<List<int>>{ new List<int>{ 61, 51, 49, 54, 75, 24, 77, 76, 80, 25 } }),
97+
new List<List<int>>{ new List<int>{ 61, 51, 49, 54, 75, 24, 77, 76, 80, 2 } }),
9898
MakeSanityTest(@"
9999
SELECT c.index AS Index, c.title AS Title, c.text AS Text
100100
FROM c
101101
WHERE FullTextContains(c.title, 'John') OR FullTextContains(c.text, 'John') OR FullTextContains(c.text, 'United States')
102102
ORDER BY RANK RRF(FullTextScore(c.title, ['John']), FullTextScore(c.text, ['United States']))
103103
OFFSET 5 LIMIT 10",
104104
new List<List<int>>{
105-
new List<int>{ 24, 77, 76, 80, 25, 22, 2, 66, 57, 85 },
106-
new List<int>{ 24, 77, 76, 80, 25, 22, 2, 66, 85, 57 },
105+
new List<int>{ 24, 77, 76, 80, 2, 22, 57, 85 },
106+
new List<int>{ 24, 77, 76, 80, 2, 22, 85, 57 },
107107
}),
108108
MakeSanityTest(@"
109109
SELECT TOP 10 c.index AS Index, c.title AS Title, c.text AS Text
110110
FROM c
111111
ORDER BY RANK RRF(FullTextScore(c.title, ['John']), FullTextScore(c.text, ['United States']))",
112-
new List<List<int>>{new List<int>{ 61, 51, 49, 54, 75, 24, 77, 76, 80, 25 } }),
112+
new List<List<int>>{new List<int>{ 61, 51, 49, 54, 75, 24, 77, 76, 80, 2 } }),
113113
MakeSanityTest(@"
114114
SELECT c.index AS Index, c.title AS Title, c.text AS Text
115115
FROM c
116116
ORDER BY RANK RRF(FullTextScore(c.title, ['John']), FullTextScore(c.text, ['United States']))
117-
OFFSET 0 LIMIT 13",
118-
new List<List<int>>{ new List<int>{ 61, 51, 49, 54, 75, 24, 77, 76, 80, 25, 22, 2, 66 } }),
117+
OFFSET 0 LIMIT 11",
118+
new List<List<int>>{ new List<int>{ 61, 51, 49, 54, 75, 24, 77, 76, 80, 2, 22 } }),
119119
MakeSanityTest($@"
120120
SELECT TOP 10 c.index AS Index, c.title AS Title, c.text AS Text
121121
FROM c
122122
ORDER BY RANK RRF(FullTextScore(c.title, ['John']), FullTextScore(c.text, ['United States']), VectorDistance(c.vector, {SampleVector}))",
123-
new List<List<int>>{new List<int>{ 21, 75, 37, 24, 26, 35, 49, 87, 55, 9 } }),
123+
new List<List<int>>{new List<int>{ 21, 37, 75, 26, 35, 24, 87, 55, 49, 9 } }),
124124
MakeSanityTest($@"
125125
SELECT TOP 10 c.index AS Index, c.title AS Title, c.text AS Text
126126
FROM c
127127
ORDER BY RANK RRF(VectorDistance(c.vector, {SampleVector}), FullTextScore(c.title, ['John']), FullTextScore(c.text, ['United States']))",
128-
new List<List<int>>{new List<int>{ 21, 75, 37, 24, 26, 35, 49, 87, 55, 9 } }),
128+
new List<List<int>>{new List<int>{ 21, 37, 75, 26, 35, 24, 87, 55, 49, 9 } }),
129129
MakeSanityTest($@"
130130
SELECT TOP 10 c.index AS Index, c.title AS Title, c.text AS Text
131131
FROM c
132132
ORDER BY RANK RRF(VectorDistance(c.vector, {SampleVector}), FullTextScore(c.title, ['John']), VectorDistance(c.image, {SampleVector}), VectorDistance(c.backup_image, {SampleVector}), FullTextScore(c.text, ['United States']))",
133-
new List<List<int>>{new List<int>{ 21, 75, 37, 24, 26, 35, 49, 87, 55, 9 } }),
133+
new List<List<int>>{new List<int>{ 21, 37, 75, 26, 35, 24, 87, 55, 49, 9 } }),
134134
};
135135

136136
await this.RunTests(testCases);

0 commit comments

Comments
 (0)