@@ -29,6 +29,7 @@ import { Script } from '@_types/Scripting'
29
29
import { QueryBase } from './abstractions'
30
30
import { Operator } from './Operator'
31
31
import { DateMath , TimeZone } from '@_types/Time'
32
+ import { FlagsEnum } from '@spec_utils/FlagsEnum'
32
33
33
34
/**
34
35
* @shortcut_property query
@@ -701,65 +702,65 @@ export class QueryStringQuery extends QueryBase {
701
702
/**
702
703
* Query flags can be either a single flag or a combination of flags, e.g. `OR|AND|PREFIX`
703
704
* @doc_id supported-flags
704
- * @codegen_names single, multiple
705
705
*/
706
- export type SimpleQueryStringFlags = SimpleQueryStringFlag | string
706
+ export type SimpleQueryStringFlags = FlagsEnum < SimpleQueryStringFlag [ ] >
707
707
708
708
export enum SimpleQueryStringFlag {
709
709
/**
710
710
* Disables all operators.
711
711
*/
712
- NONE = 1 ,
712
+ NONE = 0 ,
713
713
/**
714
714
* Enables the `+` AND operator.
715
715
*/
716
- AND = 2 ,
716
+ AND = 1 << 0 ,
717
717
/**
718
- * Enables the `\|` OR operator.
718
+ * Enables the `-` NOT operator.
719
719
*/
720
- OR = 4 ,
720
+ NOT = 1 << 1 ,
721
721
/**
722
- * Enables the `-` NOT operator.
722
+ * Enables the `\|` OR operator.
723
723
*/
724
- NOT = 8 ,
724
+ OR = 1 << 2 ,
725
+
725
726
/**
726
727
* Enables the `*` prefix operator.
727
728
*/
728
- PREFIX = 16 ,
729
+ PREFIX = 1 << 3 ,
729
730
/**
730
731
* Enables the `"` quotes operator used to search for phrases.
731
732
*/
732
- PHRASE = 32 ,
733
+ PHRASE = 1 << 4 ,
733
734
/**
734
735
* Enables the `(` and `)` operators to control operator precedence.
735
736
*/
736
- PRECEDENCE = 64 ,
737
+ PRECEDENCE = 1 << 5 ,
737
738
/**
738
739
* Enables `\` as an escape character.
739
740
*/
740
- ESCAPE = 128 ,
741
+ ESCAPE = 1 << 6 ,
741
742
/**
742
743
* Enables whitespace as split characters.
743
744
*/
744
- WHITESPACE = 256 ,
745
+ WHITESPACE = 1 << 7 ,
745
746
/**
746
747
* Enables the `~N` operator after a word, where `N` is an integer denoting the allowed edit distance for matching.
747
748
*/
748
- FUZZY = 512 ,
749
+ FUZZY = 1 << 8 ,
749
750
/**
750
751
* Enables the `~N` operator, after a phrase where `N` is the maximum number of positions allowed between matching tokens.
751
752
* Synonymous to `SLOP`.
752
753
*/
753
- NEAR = 1024 ,
754
+ NEAR = 1 << 9 ,
754
755
/**
755
756
* Enables the `~N` operator, after a phrase where `N` is maximum number of positions allowed between matching tokens.
756
757
* Synonymous to `NEAR`.
757
758
*/
758
- SLOP = 2048 ,
759
+ SLOP = 1 << 9 ,
759
760
/**
760
761
* Enables all optional operators.
761
762
*/
762
- ALL = 4096
763
+ ALL = - 1
763
764
}
764
765
765
766
export class SimpleQueryStringQuery extends QueryBase {
0 commit comments