Skip to content

Commit

Permalink
PR remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
flobernd committed Aug 14, 2023
1 parent 5195b1f commit d7d5476
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/

/**
* This type type marks the underlaying enum as a "flags enum". Individual members of flags enums
* are combined using the pipe separator ("A|B|C|...").
* A set of flags that can be represented as a single enum value or a set of values that are encoded
* as a pipe-separated string
*
* Depending on the target language, code generators can use this hint to generate language specific
* flags enum constructs and the corresponding (de-)serialization code.
*/
export type FlagsEnum<T> = T
export type PipeSeparatedFlags<T> = T | string
5 changes: 2 additions & 3 deletions specification/_types/query_dsl/fulltext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { Script } from '@_types/Scripting'
import { QueryBase } from './abstractions'
import { Operator } from './Operator'
import { DateMath, TimeZone } from '@_types/Time'
import { FlagsEnum } from '@spec_utils/FlagsEnum'
import { FlagsEnum, PipeSeparatedFlags } from '@spec_utils/PipeSeparatedFlags'

/**
* @shortcut_property query
Expand Down Expand Up @@ -703,7 +703,7 @@ export class QueryStringQuery extends QueryBase {
* Query flags can be either a single flag or a combination of flags, e.g. `OR|AND|PREFIX`
* @doc_id supported-flags
*/
export type SimpleQueryStringFlags = FlagsEnum<SimpleQueryStringFlag[]>
export type SimpleQueryStringFlags = PipeSeparatedFlags<SimpleQueryStringFlag>

export enum SimpleQueryStringFlag {
/**
Expand All @@ -722,7 +722,6 @@ export enum SimpleQueryStringFlag {
* Enables the `\|` OR operator.
*/
OR = 1 << 2,

/**
* Enables the `*` prefix operator.
*/
Expand Down

0 comments on commit d7d5476

Please sign in to comment.