This repository was archived by the owner on Jan 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
spec/cipherstash/analysis Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,15 +47,15 @@ def build_token_filters(array)
4747
4848 when "ngram"
4949 if obj [ "tokenLength" ]
50- raise CipherStash ::Client ::Error ::InternalError , "'tokenLength' is deprecated. Use 'minLength' and 'maxLength' for the ngram filter."
50+ raise CipherStash ::Client ::Error ::InvalidSchemaError , "'tokenLength' is deprecated. Use 'minLength' and 'maxLength' for the ngram filter."
5151 end
5252
5353 unless obj [ "minLength" ] . instance_of? ( Integer ) && obj [ "maxLength" ] . instance_of? ( Integer )
54- raise CipherStash ::Client ::Error ::InternalError , "The values provided to the min and max length must be of type Integer."
54+ raise CipherStash ::Client ::Error ::InvalidSchemaError , "The values provided to the min and max length must be of type Integer."
5555 end
5656
5757 unless obj [ "maxLength" ] >= obj [ "minLength" ]
58- raise CipherStash ::Client ::Error ::InternalError , "The ngram filter min length must be less than or equal to the max length"
58+ raise CipherStash ::Client ::Error ::InvalidSchemaError , "The ngram filter min length must be less than or equal to the max length"
5959 end
6060
6161 TokenFilters ::NGram . new ( obj )
Original file line number Diff line number Diff line change 2828 ] ,
2929 "tokenizer" => { "kind" => "standard" }
3030 } )
31- } . to raise_error ( CipherStash ::Client ::Error ::InternalError , "The values provided to the min and max length must be of type Integer." )
31+ } . to raise_error ( CipherStash ::Client ::Error ::InvalidSchemaError , "The values provided to the min and max length must be of type Integer." )
3232 end
3333 end
3434
4141 ] ,
4242 "tokenizer" => { "kind" => "standard" }
4343 } )
44- } . to raise_error ( CipherStash ::Client ::Error ::InternalError , "The ngram filter min length must be less than or equal to the max length" )
44+ } . to raise_error ( CipherStash ::Client ::Error ::InvalidSchemaError , "The ngram filter min length must be less than or equal to the max length" )
4545 end
4646
4747 it "raises an error if tokenLength is provided" do
5353 ] ,
5454 "tokenizer" => { "kind" => "standard" }
5555 } )
56- } . to raise_error ( CipherStash ::Client ::Error ::InternalError , "'tokenLength' is deprecated. Use 'minLength' and 'maxLength' for the ngram filter." )
56+ } . to raise_error ( CipherStash ::Client ::Error ::InvalidSchemaError , "'tokenLength' is deprecated. Use 'minLength' and 'maxLength' for the ngram filter." )
5757 end
5858
5959 it "splits text into ngrams using min length of 3 and max length of 8" do
You can’t perform that action at this time.
0 commit comments