Craticula

OpenSearch and Elasticsearch rendering

Each construct has one fixed form: the kind of term query follows the field's type, null inclusion and blank checks have fixed shapes, and every sort spells out its order and missing-value rule. Grouping uses a composite aggregation and distinct values use a terms aggregation. One compiler serves both engines, and they differ only in how a point in time is handled.

same reason as the SQL and MongoDB addenda above, of which this is the exact parallel for the third artifact family)

The SQL addendum exists because #1638 found the same IR construct rendered several different ways from identical inputs across a fixture suite seven parallel agents had hand-authored with no compiler to check it; the MongoDB one because #1643 reproduced the finding on the second arm. #1644 compiled the Search arm for the first time and reproduced it on the third and last: a term on a string was spelled long 64 times and short 4, a term on a boolean short 13 times and long once for the identical construct in two categories, must_not took an array in one notBlank and an object in three, and one artifact folded a bound value that its own six sibling arms bound as typed. So the answers are pinned here, once, and every language port inherits them instead of rediscovering them — and not as prose under SEM-1..SEM-7, whose snippets this document's own preamble disclaims as illustrative. A normative sentence there would contradict the framing, and that ambiguity is precisely what let those pairs disagree in the first place.

Each rule below is the form the spec/fixtures/*/expected/search.artifact.json files now contain — all 160 of them, page-export/'s fourteen included. That category was excluded from the conformance runner until #1650, on exportScope (#1623) and never on these rules — and four of its arms had drifted precisely because nothing could compile them, which #1644's review pass corrected under OSE-1 and OSE-3 before the exclusion was lifted. Where a rule is a refusal, there is no artifact by construction, and the fixture that used to carry one says so in its own description.md — group-aggregation/020 is the only such case. There is ONE compiler and ONE artifact for both engines (OQ-7), so unlike the SQL addendum nothing here is "the reference engine's spelling, other engines differ" — see OSE-14 for why that is a fact about the pinned subset rather than an aspiration. SQL-0 is not SQL-specific and is not restated: a compiled request takes its index from schema.source and never from the request.

OSE-0. Object key order is NOT part of this artifact contract; array order is. Nowhere in a search request body does a JSON object's key order carry meaning, so a conformance harness compares these artifacts with object keys canonicalised and arrays left as written. That is the opposite of MDB-7's arm, and deliberately: MongoDB's $sort document is order-sensitive — its key order is the tiebreak order — so the Mongo comparison is order-sensitive too. Here the order-bearing structures are arrays: sort's element order is the tiebreak order and composite.sources' is the composite key order, and both are compared as written.

Why this is a rule rather than a harness convenience. The hand-authored suite spells size before from in 78 files and after it in 50. Neither is more correct, no engine reads the difference, and picking one would have re-authored half the suite to agree about nothing. What a compiler still owes is determinism — four language ports emitting one IR in four member orders would produce four different files — so a compiler MUST fix its own order and pin it. The reference implementation emits query, sort, from, size, aggs, absent members omitted.

OSE-1. A term query's form is decided by the field's declared TYPE: the long form for a string, the short form for every other type.

{ "term": { "status.keyword": { "value": "active", "case_insensitive": true } } }
{ "term": { "status.keyword": { "value": "EMEA" } } }
{ "term": { "age": 30 } }

Why the type and not "whether a parameter is present". SEM-1 governs stringValue comparisons only, so case_insensitive — the parameter the long form exists to carry — can only ever appear on a string. Keying the spelling on the type therefore gives one field one spelling, whatever its declared caseSensitivity, which is the property the alternative loses: GRP-2 pins the parameterless string form by hand ("ES/OpenSearch drops the case_insensitive: true parameter from a drill-down term, leaving {"term": {"<field>.keyword": {"value": "EMEA"}}}") and dialect-parity/014 uses the identical shape for the case-sensitive opt-in, so a rule of "long only when the parameter is there" is already contradicted twice over. 71 string terms in the suite now take the long form, 4 of which had been authored short; 14 non-string terms take the short form, 1 of which had been authored long (filter-tree/001's boolean, whose own construct operators/044 spells short). Five artifacts were re-authored onto this rule in #1644 and its review pass — the 4 plus the 1. (This census read "64 long / 4 short" until #1650's review pass recounted it: the long figure was two short of the artifacts on disk even when it was written, and page-export/023's new arm has since added a seventy-first. The counts are the argument here, so they are stated as occurrences of term across every expected/search.artifact.json, which is what a recount reproduces.)

The fourth short one is worth naming, because it weakens the argument this rule would otherwise lean on. Three of the four were blank's empty-string sentinel (operators/029, /030, dialect-parity/019) — a compiler-minted value, an easy special case to explain away. The fourth, found by the review pass in page-export/004, is an ordinary client value on a sensitive string ({"term": {"status.keyword": "shipped"}}), and it survived only because page-export is excluded from all three conformance runners. So the artifact evidence for "the type, not the parameter" is 71-to-4 rather than 71-to-3-plus-a-sentinel, and the rule rests where it always really did: on GRP-2's normative sentence and dialect-parity/014, not on the counts. It was corrected rather than left for #1623 to re-adjudicate.

OSE-2. The composites, and the one that is spelled differently from the negation a compiler composes itself. andNode → {"bool": {"must": [...]}}, orNode → {"bool": {"should": [...], "minimum_should_match": 1}}, and a tree-level notNode → {"bool": {"must_not": [<child>]}} — an array — wrapped in the null fan-out below. A single-child composite is not collapsed ({"bool": {"must": [x]}}), mirroring SQL-2's (x) and MDB-2's {"$and": [x]}: the tree's own depth is what filter-tree/011-013 pin against SEC-3's budget, and collapsing it would make a boundary fixture indistinguishable from a shallower one.

minimum_should_match: 1 is spelled explicitly and unconditionally, and it is not decoration: a bool that also carries must or filter defaults it to 0, at which point the should clauses become scoring hints that constrain nothing. Every or a compiler emits is a real constraint, and spelling the parameter always means the same subtree renders the same way wherever it lands in the tree — SQL-2's "one rule per construct, applied always".

A tree-level NOT gets the same null fan-out as SQL-2's third bullet, at every notNode at every depth, exactly as MDB-2 records for $nor: {"bool": {"should": [{"bool": {"must_not": [<child>]}}, {"bool": {"must_not": {"exists": {"field": "<raw field>"}}}}, ...], "minimum_should_match": 1}}, one exists complement per distinct field referenced in the child subtree, in first-appearance order. A must_not alone matches a document with a missing field only when the child cannot match it, which neq, blank, an inner not or an or over two fields can (SEM-2). The inner must_not keeps its array spelling, so a tree NOT stays distinguishable from a composed negation (OSE-4).

OSE-3. The query member has two forms, chosen by the request shape. An ordinary row query renders its filter tree directly, and {"match_all": {}} when it has none — a hit-returning request always carries an explicit query. A grouping or distinct-values request wraps everything in {"bool": {"filter": [...]}}, and omits the member entirely when there is nothing to filter.

Why the second form exists. Its clauses come from two provenances that must be conjoined (GRP-5's drill-down leads, the user's own filter follows — GRP-5 pins that order), and filter is both this DSL's conjunction container and its non-scoring context, which is what a request asking for buckets rather than ranked hits wants. A top-level and on either side contributes its children to that array rather than a nested bool.must, because the array already is the conjunction — ag-grid-majors/004 pins two range clauses side by side, group-aggregation/003/004 pin the drill-down's two and three, and group-aggregation/023 pins both halves at once: a two-key drill-down and a two-column filter model flattening into one four-element array, in GRP-5's order. That is not SQL-2's "every composite wraps" being readmitted through the back door: the wrap is still there, spelled as the filter array itself. A top-level or is a single element of it, wrapped normally.

023 was authored by #1644's review pass because no fixture in the suite carried both a consumed groupKeys and a filterModel, which left GRP-5's order unpinned on all three backends at once — reversing the two compositions passed every test in every suite. Neither 003 nor 004 has a user filter, so citing them for the order (as an earlier draft of this rule did) proved only the drill-down's own flattening.

OSE-4. blank/notBlank, and the array-versus-object spelling of must_not.

// blank, string:      absent OR the empty term
{ "bool": { "should": [ { "bool": { "must_not": { "exists": { "field": "status" } } } },
                        { "term": { "status.keyword": { "value": "" } } } ],
            "minimum_should_match": 1 } }
// blank, any other type:
{ "bool": { "must_not": { "exists": { "field": "age" } } } }
// notBlank: THAT clause, negated
{ "bool": { "must_not": { <blank> } } }

notBlank is the compiled blank under a must_not and never a separately derived condition — SEM-2's third Must-NOT, satisfied structurally rather than by two renderings that happen to agree. There is no counterpart to SQL-7's second question ("does this engine treat '' as NULL?"): both engines store the empty string as an ordinary term distinct from a missing field, so the field-type half is the whole answer.

must_not takes a single clause OBJECT for a negation the compiler composed, and an ARRAY for a tree-level notNode (OSE-2). This DSL has one negation keyword where SQL has two constructs (SQL-3's negated operator versus an outer NOT (...)) and MongoDB has two operators (MDB-4's $not versus MDB-2's $nor), so the array is what keeps a one-child tree NOT distinguishable, in the artifact, from a single negated comparison. dialect-parity/019 spelled its notBlank as an array until #1644; nine filter-tree/ artifacts spell the tree form that way and three operators/ ones spell the leaf form as an object.

The empty-string sentinel carries no case_insensitive, whatever the field declares. That is not the conditional spelling OSE-1 forbids: the parameter governs how a CLIENT's value is compared and this value is not one — it is the sentinel SEM-2's own definition of blank mints. An empty string has no case to fold, so the parameter is provably inert, and GRP-2's precedent is that a compiler-minted key spells no mechanism.

OSE-5. SEM-2's null inclusion is a should of two must_nots, and the exists clause names the BASE field.

{ "bool": { "should": [ { "bool": { "must_not": <the affirmative clause> } },
                        { "bool": { "must_not": { "exists": { "field": "name" } } } } ],
            "minimum_should_match": 1 } }

Emitted for neq, notContains and notIn alike, and the affirmative clause is compiled first and then negated, so the two directions cannot drift. SEM-2's own ES worked example spells both should clauses and says why: the first alone happens to cover the missing-field case for a term query, but that is a property of term specifically and is not guaranteed for every query type an operator might compile to, so the second is explicit on every operator, unconditionally.

The exists clause names search.field, never search.keywordSubField: a .keyword sub-field's own presence is an indexing detail (ignore_above can drop a long value from it while the base field still holds one), so "this document has no value for this column" is a question only the base field answers.

OSE-6. Which of SC-4's three search names each construct addresses. They are three independent names and a compiler picks per construct, never once per field:

ConstructTarget
exists (OSE-5, OSE-4)search.field — always, whatever the comparison beside it uses
term / terms on a stringsearch.keywordSubField
wildcard (SEM-7's substring family)search.keywordSubField
match (SEM-7's searchMode: analyzed opt-in)search.field — the analyzed one is the point
range / sort on a case-insensitive stringsearch.normalizedSubField (SEM-1's one real gap) — except SEM-6's appended tiebreaker, which resolves exact and takes search.keywordSubField
range / sort on a case-sensitive stringsearch.keywordSubField
anything on a non-string field, and an aggregation metricsearch.field
a composite source / a BM-3 terms key on a stringsearch.keywordSubField

search.keywordSubField falls back to search.field when a schema declares none (the identity the schema is implicitly declaring by omitting it, the same fallback the other two compilers make for a missing mapping), and search.field falls back to the colId. search.normalizedSubField has no fallback: its absence is a compiler error. SEM-1 states it as a MUST on the schema, and both alternatives are wrong in the way this project refuses — .keyword would order "Zebra" before "apple" on a field the schema declared case-insensitive, and the analyzed base field is not sortable at all. Wrong rows in the wrong order on a request both engines accept, invisible to the artifact tier: SQL-7(b)'s and MDB-9's register.

The one carve-out, and it is load-bearing: SEM-6's appended tiebreaker resolves EXACT (see the "Superseded in part by #1640's review" note under SEM-6), so it takes search.keywordSubField even on a case-insensitive string and a schema declaring no normalizedSubField is not an error for that key. Without the carve-out the table above would demand normalizedSubField or a refusal for a key the compiler minted, which would fail two fixtures that are otherwise entirely ordinary: group-aggregation/005 and 006 declare id as a string with no text block — case-insensitive by SEM-1's default — and no normalizedSubField, and their leaf queries sort on the bare appended id. The rule is a property of the key's provenance, not of the field: the same id, sorted on because the user asked, would take normalizedSubField and refuse without one.

The bound value is never transformed. See SEM-1's own note above: the sub-field is the mechanism, a term-level query has the normalizer applied to its value at search time anyway, the compiler cannot see what that normalizer does, and "lowercase" is not one operation across four language ports.

searchMode: "analyzed" on a case-SENSITIVE field is refused, not compiled. The match row above is the SEM-7 opt-in, and a match has no case_insensitive parameter and no case control of any kind: it is resolved entirely by the field's own analyzer, and every stock text analyzer in both engines lowercases. So the combination emits a query that folds case on a field the schema declared sensitive — SEM-1's second Must-NOT, and the same failure the missing normalizedSubField is refused for, in the other direction. There is no third rendering to fall back to: a wildcard would honour the case and lose the tokenization the opt-in exists to ask for. The two declarations contradict each other, so the schema is what changes. No fixture reaches this combination — dialect-parity/013 is the suite's only analyzed field and it is case-insensitive — which is precisely why it is written down here.

OSE-7. Set membership is a terms query — except on a case-insensitive string, where it is a should of term queries. (An empty list is SEM-8's constant, match_none / match_all, before either form.)

{ "terms": { "age": [30, 40] } }
{ "bool": { "should": [ { "term": { "status.keyword": { "value": "active",  "case_insensitive": true } } },
                        { "term": { "status.keyword": { "value": "pending", "case_insensitive": true } } } ],
            "minimum_should_match": 1 } }

Not a stylistic split: terms has no case_insensitive parameter in the pinned subset (the parameter exists on term, prefix, wildcard and regexp only), so it cannot realize SEM-1's mechanism at all, and emitting it anyway would silently make in case-sensitive on a field the schema declared insensitive — SEM-1's second Must-NOT. The disjunction is the same set membership with the parameter available on each member. operators/035 and dialect-parity/016 pin the disjunction; operators/037 and dialect-parity/018 (a sensitive column) pin the compact form.

OSE-8. range carries every bound of one IR leaf, plus an explicit format for a date-typed field and nothing else. The four ordering operators and inRange are all one range query — inRange included, because it is a single rangeComparisonNode, the same argument MDB-6 makes for MongoDB's single field document. An AG Grid within-column AND of two conditions IS two leaves and does render as two clauses (ag-grid-majors/002).

OSE-9. Every sort element spells both order and missing. SEM-3's null placement is a native parameter here — no emulation, nothing to unset afterwards, unlike MySQL's ISNULL prefix key or MongoDB's synthetic bucket. It is spelled on every key unconditionally, including SEM-6's appended tiebreaker: SEM-3's first Must-NOT forbids relying on an engine's implicit default even when it happens to match today, and SEM-6's fourth forbids "the stable key is probably never null" as a licence to omit the marker.

A repeated sort key does not reach this compiler: SEM-6 drops a later occurrence of a field before the sort is compiled (Bug #2565), so there is nothing to reject here for a repeated colId. (The one shape that still lists a column twice, a case-insensitive text stable key with keys after it, names two different sub-fields on this arm, normalizedSubField and keywordSubField, and is served.) The difference this paragraph used to draw is still the reason the two engines needed different answers before that reduction: sort is an ARRAY, where a colId sent twice is merely redundant and the primary key stays primary, whereas a $sort document silently replaces the first entry and promotes the secondary key.

Which sub-field each key addresses is OSE-6's table, including its one carve-out, which is easy to lose sight of here because this rule is about the two parameters rather than the target: a user's own key on a case-insensitive string takes search.normalizedSubField and refuses when the schema declares none, while SEM-6's appended tiebreaker resolves exact and takes search.keywordSubField — the same field can therefore be a hard error in one position and perfectly ordinary in the other. group-aggregation/005 and 006 are the fixtures that depend on it: both sort a leaf on the appended id, a string with no text block and no normalizedSubField.

OSE-10. from and size, and the two members a bucket request does not have. from takes startRow and size the row COUNT (endRow - startRow, because endRow is exclusive). Both are emitted for a range page even when the offset is zero. EXP-2's page: none emits neither (sort-paging/012). A grouping or distinct-values request emits "size": 0 — it wants buckets and no hits — and no sort and no from at all; the two request shapes are structurally different bodies rather than one body with optional members, and size: 0 beside a sort orders nothing.

search_after is deliberately never emitted. PERF-2 scopes it to deep paging beyond max_result_window, with a cursor cache it assigns by name to the execution adapter (#1622). max_result_window is index configuration absent from GridSchema and from the IR; the cursor is the previous page's last sort values, which an offset-based AG Grid SSRM request never sends and $defs/pageSpec has nowhere to carry. All 160 search.artifact.json files pin the offset form. spec/fixtures/schemas/search-artifact.schema.json admits the member so that #1622 can use it without a schema change; nothing does today.

OSE-11. The grouped level is a composite aggregation, and five of its details are decided here.

{ "size": 0,
  "aggs": { "<group column>": {
    "composite": { "size": <row window>,
                   "sources": [ { "<group column>": { "terms": { "field": "<keyword sub-field>",
                                                                 "missing_bucket": true } } } ] },
    "aggs": { "<output name>": { "<sum|min|max|avg|value_count>": { "field": "<base field>" } } } } } }

(a) composite rather than terms, and missing_bucket rather than nothing. A grouped level is paged, and composite is the only bucket aggregation in this subset that enumerates every bucket in key order rather than returning an approximate top-N by doc count. It is also the only one with missing_bucket, which is what keeps a null group key from being silently dropped (AR-8/BM-2's intent). count needs no special construction: value_count already skips missing values, so AGG-1 is satisfied natively — unlike MongoDB, where AGG-1 has to forbid {"$sum": 1} by name. The metric's field is the base field.

(b) AGG-5's accepted divergence, honoured rather than worked around. missing_bucket: true has no missing_order control in the pinned 7.10-era subset: the null bucket sorts first regardless of the direction requested, while Postgres (NULLS FIRST/NULLS LAST) and MongoDB (its bucket emulation) both honour it. The group key's own nullsPosition therefore compiles to nothing at all here, and that silence is the rule rather than an omission. A client-side reorder would defeat server-side paging's whole purpose for the grouped case.

(c) The bucket ordering: the group column alone, and every other ordering is REFUSED. AGG-4 exists because a bare terms aggregation defaults to doc-count-descending, an order no other backend would produce. A composite source is ordered by its key by construction, so there is no wrong default to guard against, and its order parameter carries the DIRECTION the request asked for (GRP-4) rather than a fixed asc. It is spelled only for desc, the source's documented default being ascending — group-aggregation/021 pins the one, the other fifteen composite artifacts pin its absence.

A grouped level ordered by anything other than its own group column is a compiler error. A composite source can only order by its own key, and the obvious workaround — a bucket_sort sub-aggregation — does not answer the question that was asked. A composite always enumerates buckets in composite-key order and returns size of them; bucket_sort is post-processing that reorders only the buckets that page already contains. So "the 100 largest regions by revenue" would compile to the first 100 regions in key order, rearranged by revenue — with more distinct regions than the window, a different set of groups, silently, and invisibly to the artifact tier. Elasticsearch's own composite documentation states the general form of this rather than a "limit": a composite aggregation is not compatible with pipeline aggregations, and gives exactly this reason.

So the refusal is in OSE-11(d)'s own register, and in SQL-7(b)'s and MDB-9's: a plausible request that answers a different question is worse than an error naming the reason. This is a real, user-visible capability gap on this backend and must be stated as one — ordering a grouped level by an aggregate does not work on OpenSearch/Elasticsearch. Closing it needs a different grouped-ordering strategy (a two-pass terms-then-composite plan, or a full bucket enumeration reordered client-side), not a different spelling; that is the execution adapter's business (#1622) and gradeable only against a live cluster (#1624).

Superseded in part by #1644's review pass. This rule previously rendered such an ordering as a bucket_sort sub-aggregation named sortBy<PascalCase(first sort colId)>, pinned by group-aggregation/020, with a recorded T-1b risk asking #1624 whether 7.10-era servers accept a pipeline aggregation under a composite. Acceptance was never the real question: even when accepted, the result answers a different question from every other backend's arm, which is settled here and needs no cluster. 020's Search arm has been deleted, the rule is a refusal, and the bucket_sort naming and its collision rule are gone with it.

(d) The two row windows that are refused. A composite pages forward with an after key rather than an offset, so a grouped level asked for a non-zero startRow has no rendering, and one asked for EXP-2's page: none has no bucket count to give. Both are compiler errors. Emitting size and dropping the offset would answer every page with the first one — a plausible request answering a different question, silently — which is SQL-7(b)'s and MDB-9's register again.

The offset half is a first-page-only limitation, not a deep-paging one, and conflating it with PERF-2's search_after (OSE-10) understates it badly. search_after escalates only beyond max_result_window, 10 000 rows by default, so an ordinary grid never reaches it; AG Grid SSRM's default block size is 100 rows, so the second block of any grouped level — one screen of scrolling past the first hundred groups — lands here. Every grouped grid on this backend hits it, not only the deep ones. The owner is the same (the execution adapter, #1622, because the after key is the previous response's own after_key and neither $defs/pageSpec nor GridSchema can carry it), but the urgency is not.

(e) Aggregation names are validated, not assumed. An aggregate's output name is AGG-2's alias when one is set and <field>_<func> otherwise, and the default is held to the same ^[A-Za-z_][A-Za-z0-9_]*$ pattern ir.schema.json already imposes on alias. That pattern exists because the name "lands in generated query text as an identifier … where SEC-2's values-are-parameters rule cannot apply", but $defs/fieldName carries no pattern at all, so a nested colId such as customer.name composes a default customer.name_sum that no validator has ever seen — and here an aggregation name is read through a buckets_path mini-language in which > navigates into a sub-aggregation and . selects a metric. A default name failing the pattern is refused, naming alias as the fix. The bucket aggregation's own name (the group column, or BM-3's colId) is held to the engines' own narrower rule instead — no [, ] or >, which both engines reject outright — because a dotted colId is a perfectly good container key and refusing it would break a nested-document schema for nothing. Two names, two standards, because they are read by two different things: one is an identifier the grid reads a number back by, the other is only ever a key. MDB-10's third collision also applies here verbatim: two aggregates resolving to one output name are refused, since the aggs container is a JSON object and the second would silently replace the first.

OSE-12. BM-3's distinct values are a terms aggregation, and GRP-6(c)'s search prefix is its include.

{ "size": 0,
  "aggs": { "<colId>": { "terms": { "field": "<keyword sub-field>",
                                    "size": <resolved cap>,
                                    "include": "<escaped prefix>.*",
                                    "order": { "_key": "asc" } } } } }

OSE-13. There is no projection member: neither GRP-3 nor EXP-1(b) has a counterpart on this backend. spec/fixtures/schemas/search-artifact.schema.json declares additionalProperties: false over a member set with no _source in it, so this is a contract rather than an omission. GRP-3's concern is a physical column name reaching a grid that asked for a logical one; a hit's _source carries the document's own field names, which the index mapping decides once rather than per query, so the question is answered at index time. A drill-down leaf therefore emits no column list where SQL emits an aliased one and MongoDB emits a $project — asserted as an expected difference rather than left as an absence.

EXP-1(b)'s export column list reaches the same answer, and _source filtering is declined, not overlooked. Elasticsearch and OpenSearch both support _source: [...] (and _source: {includes, excludes}) on a search body, so narrowing is available here in a way it is not for GRP-3's aliasing problem — the omission is therefore a decision and is recorded as one. Three grounds: it would be a narrowing only, never a renaming or a reordering, so it could not deliver EXP-1(b)'s ordered, logically-named column list and the writer would still have to do the whole job from exportColumns; adding a member to the artifact's closed set would make it the one place where this backend's compiled body varies with a property that changes nothing else about which documents match; and the saving is bandwidth between the engine and the host process, which is an execution-adapter trade-off (the same register as EXP-3's streaming and chunking, which is what that id really names) rather than a compiled-query semantic. The fourteen page-export/ Search arms pin the absence: 008 narrows to three of seven columns on SQL and MongoDB and its Search arm carries only a query and a sort. If a host wants the bandwidth, _source is an adapter-level addition to the request it sends, not a change to this contract.

OSE-14. One compiler, both engines, and no target flag — a fact about the pinned subset, not an aspiration. #1621's DoD asks for OpenSearch-versus-Elasticsearch divergences to sit "behind a target flag, not a second compiler". No such divergence exists in this subset, so there is no flag: a one-setting flag is the same smell as a one-implementation dialect seam, which is why there is no IMongoDialect either. Every construct this addendum names predates the fork (OpenSearch forked Elasticsearch 7.10.2) and is spelled identically on both sides of it. The one parameter worth checking is case_insensitive, SEM-1's mechanism here, which Elasticsearch added in 7.10 — the very release OpenSearch forked from — so OpenSearch 1.0 inherited it and every supported version of both engines has it. That is also this compiler's version floor, recorded in the same register as Oracle's 12.2 (SQL-6), SQLite's 3.30.0 and MongoDB's 4.2 (MDB-12), and it is a loud failure when unmet (unknown parameter [case_insensitive]) rather than a silent one. If a future construct genuinely does diverge, the seam to add is the one this project already uses for that shape of problem (BM-1's Dialect), not a boolean threaded through a builder.

OSE-15. The one place the two engines differ is the point-in-time lifecycle, and it is client configuration, not part of the artifact. OSE-14 holds for everything a compiler writes: one artifact, no target flag. An execution adapter that pages beyond max_result_window (PERF-2, OSE-10) or exports (EXP-3) opens a point-in-time first and closes it last, and that call differs, in exactly four places and nowhere else:

OpenSearch 2.xElasticsearch 8.x
createPOST /{index}/_search/point_in_time?keep_alive=<duration>POST /{index}/_pit?keep_alive=<duration>
key holding the id in the answerpit_idid
closeDELETE /_search/point_in_timeDELETE /_pit
close body{"pit_id":["<id>"]}{"id":"<id>"}

Searching with the point-in-time is the same on both: pit (id, keep_alive) in the request body, search_after from the previous hit's sort, and pit_id in the answer. An adapter therefore takes the engine as a host setting (OpenSearch, the default, or Elasticsearch) and applies it only to those four places. The setting never reaches search.artifact.json, the compiler or a fixture; a conformance harness does not see it. An adapter that cannot tell which engine it talks to uses OpenSearch, and against Elasticsearch fails loudly (HTTP 400), never silently. The close stays best-effort and the keep-alive is still sent on every search (OSE-10).

OSE-16. The row count above max_result_window is unknown by default, and a host may opt in to the exact count. PERF-3 asks for a bounded count, and the one a search engine gives cheaply is capped: track_total_hits: <window> clamps the reported value at the window and reports relation: "gte" once the true total is larger. The adapter therefore reports no count (RowCount null, so the grid's lastRow stays unknown and the grid keeps asking for blocks, PERF-2) when the total exceeds max_result_window, and the exact one below it; it never reports the clamped number as if it were exact. The default stays, because the exact count costs the cluster a count of every matching document on each first-block request. A host that wants the total opts in with one setting (ExactRowCount), which changes only the count request to track_total_hits: true: the page query, the point-in-time walk and the compiled artifact are unchanged, so no fixture and no other backend is affected. A grouped level's count is a cardinality aggregation (approximate beyond its precision threshold) and is not affected by the setting.

Cross-links. spec/fixtures/schemas/search-artifact.schema.json (the member set OSE-13 rests on), $defs/andNode, $defs/orNode, $defs/notNode, $defs/unaryOperator, $defs/binaryOperator, $defs/setOperator, $defs/rangeComparisonNode, $defs/sortItem, $defs/setValuesSpec, SEM-1, SEM-2, SEM-3, SEM-4, SEM-6, SEM-7, SEC-4, SEC-5, AGG-1, AGG-2, AGG-4, AGG-5, AGG-6 (already satisfied natively here — the sum metric returns 0 and the other three return null, so no metric aggregation changes), GRP-2..GRP-6, and the SQL addendum's SQL-0 (source) and SQL-2 (the composite wrap OSE-2 parallels).