From 594784c5cb62e6df23a3ab76762e86623195b975 Mon Sep 17 00:00:00 2001 From: Jim DeFabia Date: Wed, 25 Oct 2023 14:15:44 -0400 Subject: [PATCH] HPCC-22229 INDEX docs should show how to use "results in" (=>) operator for payload index Signed-off-by: Jim DeFabia --- .../ECLR_mods/RecordStructure.xml | 12 ++++++++++++ .../ECLLanguageReference/ECLR_mods/Recrd-Index.xml | 7 +++++++ 2 files changed, 19 insertions(+) diff --git a/docs/EN_US/ECLLanguageReference/ECLR_mods/RecordStructure.xml b/docs/EN_US/ECLLanguageReference/ECLR_mods/RecordStructure.xml index 56ee18a89c7..d676aa05aeb 100644 --- a/docs/EN_US/ECLLanguageReference/ECLR_mods/RecordStructure.xml +++ b/docs/EN_US/ECLLanguageReference/ECLR_mods/RecordStructure.xml @@ -186,6 +186,18 @@ within those functions that require record structures (OUTPUT, TABLE, DATASET etc.), instead of defining the record as a separate definition. + + If the RECORD structure is defining an INDEX, you can also use the + "results in" operator (=>) before payload fields as shown below. + + VehicleKey2 := INDEX(Vehicles,SearchTerms,Payload,'vkey::st.city2'); +BUILD(VehicleKey2); + +// Using "results in" operator (=>) for payload fields +VehicleKey3 := INDEX(Vehicles,{st,city => lname},'vkey::st.city3'); +BUILD(VehicleKey3); + + diff --git a/docs/EN_US/ECLLanguageReference/ECLR_mods/Recrd-Index.xml b/docs/EN_US/ECLLanguageReference/ECLR_mods/Recrd-Index.xml index feed4cd55fc..a1b9358527d 100644 --- a/docs/EN_US/ECLLanguageReference/ECLR_mods/Recrd-Index.xml +++ b/docs/EN_US/ECLLanguageReference/ECLR_mods/Recrd-Index.xml @@ -318,6 +318,9 @@ Bld := BUILDINDEX(AlphaInStateCity); sorting behavior can be controlled by using sortIndexPayload in a #OPTION statement. + You can also use the "results in" operator (=>) before payload + fields as shown below. + Example: Vehicles := DATASET('vehicles', @@ -336,6 +339,10 @@ Payload := RECORD END; VehicleKey2 := INDEX(Vehicles,SearchTerms,Payload,'vkey::st.city2'); BUILD(VehicleKey2); + +// Using "results in" operator (=>) for payload fields +VehicleKey3 := INDEX(Vehicles,{st,city => lname},'vkey::st.city3'); +BUILD(VehicleKey3);