cozydev-pink / protosearch

prototype search library in pure scala
https://cozydev-pink.github.io/protosearch/
Apache License 2.0
9 stars 6 forks source link

Fix prefix search for nonexistent prefixes #56

Closed valencik closed 1 year ago

valencik commented 1 year ago

Fixes and ArrayIndexOutOfBoundsException on prefix searches where the prefix does not match any term in the term dictionary.

Thanks to @armanbilge for tracking down while things were crashing. :tada:

Uncaught org.scalajs.linker.runtime.UndefinedBehaviorError: java.lang.ArrayIndexOutOfBoundsException: 4470
    at $throwArrayIndexOutOfBoundsException (main.js:60:9)
    at ArrayClass.get (main.js:644:5)
    at $c_Lpink_cozydev_protosearch_Index$$anon$1.docsForPrefix__T__sci_Set (main.js:33850:72)
    at $p_Lpink_cozydev_protosearch_BooleanRetrieval__booleanModel__Lpink_cozydev_lucille_Query__s_util_Either (main.js:103078:81)
    at $c_Lpink_cozydev_protosearch_BooleanRetrieval.search__Lpink_cozydev_lucille_Query__s_util_Either (main.js:103334:14)
    at $p_Lpink_cozydev_protosearch_MultiIndex__booleanModel__Lpink_cozydev_lucille_Query__s_util_Either (main.js:103646:78)