none
Append text in one of the fields of the search results using ResultScriptWebPart RRS feed

  • Question

  • Hi,

    I have extended ResultScriptWebPart and would like to update the fields with a constant value based on a backend logic.

    QueryIssuing -> Event

    // After ExecutyQuery()
             var resultTables = resultTableCollection.Filter("TableType", KnownTableTypes.RelevantResults);           
                foreach (ResultTable item in resultTables)
                {
                    int count = item.Table.Rows.Count;
                    DataRow row = null;
                    for (int i=0; i<count; i++)
                    {
                        item.Table.Rows[i]["Flag1"] = "This field is updated."                    
                    }                

                         resultCollection.Add(item);

             e.Result = resultCollection

    In my search display template, I added "Flag1" into my ManagedProperty mapping but the value still blank. Can it be done this way? 

    Any feedback is greatly appreciated. Thanks.


    Sunday, May 11, 2014 2:57 PM

Answers

All replies