Use time independent IDs

* the math index used the curid field to
  refer to the search result
* this change uses the oldid field instead

This change requires to rebuild the mathindex.

Change-Id: I28c46732896566c3cbc8f4caf59bb1744a5877e0