@@ -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 , PipeSeparatedFlags } from '@spec_utils/PipeSeparatedFlags'
32
33
33
34
/**
34
35
* @shortcut_property query
@@ -701,65 +702,64 @@ 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 = PipeSeparatedFlags < 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
* Enables the `*` prefix operator.
727
727
*/
728
- PREFIX = 16 ,
728
+ PREFIX = 1 << 3 ,
729
729
/**
730
730
* Enables the `"` quotes operator used to search for phrases.
731
731
*/
732
- PHRASE = 32 ,
732
+ PHRASE = 1 << 4 ,
733
733
/**
734
734
* Enables the `(` and `)` operators to control operator precedence.
735
735
*/
736
- PRECEDENCE = 64 ,
736
+ PRECEDENCE = 1 << 5 ,
737
737
/**
738
738
* Enables `\` as an escape character.
739
739
*/
740
- ESCAPE = 128 ,
740
+ ESCAPE = 1 << 6 ,
741
741
/**
742
742
* Enables whitespace as split characters.
743
743
*/
744
- WHITESPACE = 256 ,
744
+ WHITESPACE = 1 << 7 ,
745
745
/**
746
746
* Enables the `~N` operator after a word, where `N` is an integer denoting the allowed edit distance for matching.
747
747
*/
748
- FUZZY = 512 ,
748
+ FUZZY = 1 << 8 ,
749
749
/**
750
750
* Enables the `~N` operator, after a phrase where `N` is the maximum number of positions allowed between matching tokens.
751
751
* Synonymous to `SLOP`.
752
752
*/
753
- NEAR = 1024 ,
753
+ NEAR = 1 << 9 ,
754
754
/**
755
755
* Enables the `~N` operator, after a phrase where `N` is maximum number of positions allowed between matching tokens.
756
756
* Synonymous to `NEAR`.
757
757
*/
758
- SLOP = 2048 ,
758
+ SLOP = 1 << 9 ,
759
759
/**
760
760
* Enables all optional operators.
761
761
*/
762
- ALL = 4096
762
+ ALL = - 1
763
763
}
764
764
765
765
export class SimpleQueryStringQuery extends QueryBase {
0 commit comments