4 Replies
      Latest reply on Mar 14, 2019 2:50 PM by testUser3434
      testUser3434 Level 1 Level 1 (0 points)

        Hi guys,

         

        I am triggering a search request to my algolia server and I receive following json-response:

        {
            "_highlightResult" =     {
             
                description =         {
                    matchLevel = none;
                    matchedWords =             (
                    );
                    value = Test;
                };
               
                title =         {
                    fullyHighlighted = 0;
                    matchLevel = full;
                    matchedWords =             (
                        d
                    );
                    value = "<em>D</em>e Saygin";
                };
            };
            description = Test;
            title = "De Saygin";
        }
        )
        
        

        Can anyone tell me, how I can get the values for description and title?

        I tried following code:

        challengeIndex.search(query) { (jsonObject, error) in
                    
                    // Decode JSON
                    guard let hits = content![""] as? [[String: AnyObject]] else { return }
                    for hit in hits {
                        tmp.append(MovieRecord(json: hit))
                    }
                    completionHandler(challengeArray)
                }
        
        
        

        but the variable hits (line 05) is always empty. Any ideas?