Created
          June 23, 2017 19:52 
        
      - 
      
 - 
        
Save shofetim/7bc22caf09f2b68aedda191232a9f598 to your computer and use it in GitHub Desktop.  
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function parseLabel(label, r) { | |
| const res = r || []; | |
| res.push(label.label_name.replace(/[,\s]+$/g, '').trim()) | |
| if (label.label_child) { | |
| parseLabel(label.label_child, res) | |
| } | |
| return res.join(', '); | |
| } | |
| classifications = parseLabel(result._source.classifications[0]) | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment