Skip to content

Commit

Permalink
Merge pull request #17957 from JamesDeFabia/HPCC-22229ResultsInPayload
Browse files Browse the repository at this point in the history
HPCC-22229 INDEX docs show how to use "results in" (=>) operator for payload index

Reviewed-By: Richard Taylor <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Oct 26, 2023
2 parents 3522729 + 594784c commit 76f179e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/EN_US/ECLLanguageReference/ECLR_mods/RecordStructure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,18 @@
within those functions that require record structures (OUTPUT, TABLE,
DATASET etc.), instead of defining the record as a separate
definition.</para>

<para>If the RECORD structure is defining an INDEX, you can also use the
"results in" operator (=&gt;) before payload fields as shown below.</para>

<programlisting lang="ECL" role="NOTRunnable">VehicleKey2 := INDEX(Vehicles,SearchTerms,Payload,'vkey::st.city2');
BUILD(VehicleKey2);

// Using "results in" operator (=&gt;) for payload fields
VehicleKey3 := INDEX(Vehicles,{st,city =&gt; lname},'vkey::st.city3');
BUILD(VehicleKey3);</programlisting>

<para></para>
</sect2>

<sect2 id="Field_Definitions">
Expand Down
7 changes: 7 additions & 0 deletions docs/EN_US/ECLLanguageReference/ECLR_mods/Recrd-Index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,9 @@ Bld := BUILDINDEX(AlphaInStateCity);</programlisting>
sorting behavior can be controlled by using
<emphasis>sortIndexPayload</emphasis> in a #OPTION statement.</para>

<para>You can also use the "results in" operator (=&gt;) before payload
fields as shown below.</para>

<para>Example:</para>

<programlisting>Vehicles := DATASET('vehicles',
Expand All @@ -336,6 +339,10 @@ Payload := RECORD
END;
VehicleKey2 := INDEX(Vehicles,SearchTerms,Payload,'vkey::st.city2');
BUILD(VehicleKey2);

// Using "results in" operator (=&gt;) for payload fields
VehicleKey3 := INDEX(Vehicles,{st,city =&gt; lname},'vkey::st.city3');
BUILD(VehicleKey3);
</programlisting>
</sect2>

Expand Down

0 comments on commit 76f179e

Please sign in to comment.