Do not try to access highlighted attributes without checking if they exist

The JS code was accessing an undefined ```excerpt``` attribute (```excerpt``` is not highlighted, because I didn't include it in the ```attributesToIndex``` list):

```json
{
  "attributesToIndex":["title","unordered(content)"],
  "customRanking":["desc(modified)"]
} 
```