Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit e688581

Browse files
committed
Add tests for facet range search on different field ids
1 parent 4ac8f96 commit e688581

File tree

9 files changed

+562
-3
lines changed

9 files changed

+562
-3
lines changed

milli/src/search/facet/facet_range_search.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,8 @@ mod tests {
611611
];
612612
for (i, index) in indexes.iter().enumerate() {
613613
let txn = index.env.read_txn().unwrap();
614-
let mut results = String::new();
614+
let mut results_0 = String::new();
615+
let mut results_1 = String::new();
615616
for i in 0..=255 {
616617
let i = i as f64;
617618
let start = Bound::Included(i);
@@ -627,9 +628,23 @@ mod tests {
627628
)
628629
.unwrap();
629630
#[allow(clippy::format_push_string)]
630-
results.push_str(&format!("{i}: {}\n", display_bitmap(&docids)));
631+
results_0.push_str(&format!("{i}: {}\n", display_bitmap(&docids)));
632+
633+
let mut docids = RoaringBitmap::new();
634+
find_docids_of_facet_within_bounds::<OrderedF64Codec>(
635+
&txn,
636+
index.content.remap_key_type::<FacetGroupKeyCodec<OrderedF64Codec>>(),
637+
1,
638+
&start,
639+
&end,
640+
&mut docids,
641+
)
642+
.unwrap();
643+
#[allow(clippy::format_push_string)]
644+
results_1.push_str(&format!("{i}: {}\n", display_bitmap(&docids)));
631645
}
632-
milli_snap!(results, format!("exact_{i}"));
646+
milli_snap!(results_0, format!("field_id_0_exact_{i}"));
647+
milli_snap!(results_1, format!("field_id_1_exact_{i}"));
633648

634649
drop(txn);
635650
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
source: milli/src/search/facet/facet_range_search.rs
3+
---
4+
9c25261cec7275cb5cfd85835904d023
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
source: milli/src/search/facet/facet_range_search.rs
3+
---
4+
2f97f18c15e915853e4df879be6e1f63
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
source: milli/src/search/facet/facet_range_search.rs
3+
---
4+
9c25261cec7275cb5cfd85835904d023
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
source: milli/src/search/facet/facet_range_search.rs
3+
---
4+
2f97f18c15e915853e4df879be6e1f63
Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,260 @@
1+
---
2+
source: milli/src/search/facet/facet_range_search.rs
3+
---
4+
0: []
5+
1: []
6+
2: []
7+
3: []
8+
4: []
9+
5: []
10+
6: []
11+
7: []
12+
8: []
13+
9: []
14+
10: []
15+
11: []
16+
12: []
17+
13: []
18+
14: []
19+
15: []
20+
16: []
21+
17: []
22+
18: []
23+
19: []
24+
20: []
25+
21: []
26+
22: []
27+
23: []
28+
24: []
29+
25: []
30+
26: []
31+
27: []
32+
28: []
33+
29: []
34+
30: []
35+
31: []
36+
32: []
37+
33: []
38+
34: []
39+
35: []
40+
36: []
41+
37: []
42+
38: []
43+
39: []
44+
40: []
45+
41: []
46+
42: []
47+
43: []
48+
44: []
49+
45: []
50+
46: []
51+
47: []
52+
48: []
53+
49: []
54+
50: []
55+
51: []
56+
52: []
57+
53: []
58+
54: []
59+
55: []
60+
56: []
61+
57: []
62+
58: []
63+
59: []
64+
60: []
65+
61: []
66+
62: []
67+
63: []
68+
64: []
69+
65: []
70+
66: []
71+
67: []
72+
68: []
73+
69: []
74+
70: []
75+
71: []
76+
72: []
77+
73: []
78+
74: []
79+
75: []
80+
76: []
81+
77: []
82+
78: []
83+
79: []
84+
80: []
85+
81: []
86+
82: []
87+
83: []
88+
84: []
89+
85: []
90+
86: []
91+
87: []
92+
88: []
93+
89: []
94+
90: []
95+
91: []
96+
92: []
97+
93: []
98+
94: []
99+
95: []
100+
96: []
101+
97: []
102+
98: []
103+
99: []
104+
100: []
105+
101: []
106+
102: []
107+
103: []
108+
104: []
109+
105: []
110+
106: []
111+
107: []
112+
108: []
113+
109: []
114+
110: []
115+
111: []
116+
112: []
117+
113: []
118+
114: []
119+
115: []
120+
116: []
121+
117: []
122+
118: []
123+
119: []
124+
120: []
125+
121: []
126+
122: []
127+
123: []
128+
124: []
129+
125: []
130+
126: []
131+
127: []
132+
128: []
133+
129: []
134+
130: []
135+
131: []
136+
132: []
137+
133: []
138+
134: []
139+
135: []
140+
136: []
141+
137: []
142+
138: []
143+
139: []
144+
140: []
145+
141: []
146+
142: []
147+
143: []
148+
144: []
149+
145: []
150+
146: []
151+
147: []
152+
148: []
153+
149: []
154+
150: []
155+
151: []
156+
152: []
157+
153: []
158+
154: []
159+
155: []
160+
156: []
161+
157: []
162+
158: []
163+
159: []
164+
160: []
165+
161: []
166+
162: []
167+
163: []
168+
164: []
169+
165: []
170+
166: []
171+
167: []
172+
168: []
173+
169: []
174+
170: []
175+
171: []
176+
172: []
177+
173: []
178+
174: []
179+
175: []
180+
176: []
181+
177: []
182+
178: []
183+
179: []
184+
180: []
185+
181: []
186+
182: []
187+
183: []
188+
184: []
189+
185: []
190+
186: []
191+
187: []
192+
188: []
193+
189: []
194+
190: []
195+
191: []
196+
192: []
197+
193: []
198+
194: []
199+
195: []
200+
196: []
201+
197: []
202+
198: []
203+
199: []
204+
200: []
205+
201: []
206+
202: []
207+
203: []
208+
204: []
209+
205: []
210+
206: []
211+
207: []
212+
208: []
213+
209: []
214+
210: []
215+
211: []
216+
212: []
217+
213: []
218+
214: []
219+
215: []
220+
216: []
221+
217: []
222+
218: []
223+
219: []
224+
220: []
225+
221: []
226+
222: []
227+
223: []
228+
224: []
229+
225: []
230+
226: []
231+
227: []
232+
228: []
233+
229: []
234+
230: []
235+
231: []
236+
232: []
237+
233: []
238+
234: []
239+
235: []
240+
236: []
241+
237: []
242+
238: []
243+
239: []
244+
240: []
245+
241: []
246+
242: []
247+
243: []
248+
244: []
249+
245: []
250+
246: []
251+
247: []
252+
248: []
253+
249: []
254+
250: []
255+
251: []
256+
252: []
257+
253: []
258+
254: []
259+
255: []
260+

0 commit comments

Comments
 (0)