File tree Expand file tree Collapse file tree 3 files changed +28
-2
lines changed
src/annis/db/aql/operators Expand file tree Collapse file tree 3 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
if a backup folder exists.
12
12
- Add bug fixes for relANNIS import discovered testing the Annatto relANNIS
13
13
importer.
14
-
14
+ - Fix ` FileTooLarge ` error when searching for token precedence where the
15
+ statistics indicate that this search is impossible.
15
16
16
17
## [ 3.3.1] - 2024-06-04
17
18
Original file line number Diff line number Diff line change @@ -178,7 +178,8 @@ impl<'a> BinaryOperatorBase for Precedence<'a> {
178
178
std:: ops:: Bound :: Excluded ( max_dist) => max_dist - 1 ,
179
179
} ;
180
180
let max_possible_dist = std:: cmp:: min ( max_dist, stats_order. max_depth ) ;
181
- let num_of_descendants = max_possible_dist - self . spec . dist . min_dist ( ) + 1 ;
181
+ let num_of_descendants =
182
+ max_possible_dist. saturating_sub ( self . spec . dist . min_dist ( ) ) + 1 ;
182
183
183
184
return Ok ( EstimationType :: Selectivity (
184
185
( num_of_descendants as f64 ) / ( stats_order. nodes as f64 / 2.0 ) ,
Original file line number Diff line number Diff line change @@ -364,3 +364,27 @@ fn negative_token_search_applies_leaf_filter() {
364
364
}
365
365
}
366
366
}
367
+
368
+ #[ ignore]
369
+ #[ test]
370
+ fn no_error_on_large_token_distance ( ) {
371
+ let cs = CORPUS_STORAGE . as_ref ( ) . unwrap ( ) ;
372
+
373
+ let q = SearchQuery {
374
+ corpus_names : & [ "subtok.demo" ] ,
375
+ query : r#"tok .100 tok"# ,
376
+ query_language : QueryLanguage :: AQL ,
377
+ timeout : None ,
378
+ } ;
379
+ // There should be an empty result, but no error
380
+ let result = cs
381
+ . find (
382
+ q. clone ( ) ,
383
+ 0 ,
384
+ Some ( 1 ) ,
385
+ graphannis:: corpusstorage:: ResultOrder :: Normal ,
386
+ )
387
+ . unwrap ( ) ;
388
+
389
+ assert_eq ! ( 0 , result. len( ) ) ;
390
+ }
You can’t perform that action at this time.
0 commit comments