I don't know why this is happening in my ruby, but do you see the same behaviour?
3.1.2 :001 > ["url", "label:from", "label:type", "label:batch", "note"].index('url')
=> nil
3.1.2 :002 > ["url", "label:from", "label:type", "label:batch", "note"].index('note')
=> 4
3.1.2 :003 > ["Url", "label:from", "label:type", "label:batch", "note"].index('Url')
=> 0
It can't find 'url' when downcased. Is this a reserved word?
Edit: it seems not to be able to find the first occurrence of "url" string:
["note", "url", "label:from", "label:type", "label:batch", "note", "url"].index 'url'
=> 6