I am indexing some custom files using FileBasedIndex'ing. And have an extension class for gotoClassContributor, so we can search for the class in Intellij. In the extension class I implement the getItemsByName() function, which when passed a key, is supposed to processes some values corresponding the key and returns the required NavigationItems. Since we already have the key in getItemsByName(), I am trying to get the corresponding values(which have been externalized), using FileBasedIndex.getValues(). The problem is that FileBasedIndex.getValues() returns the corresponding values only when the file in which the class I am searching has been modified. In other cases I getValues() returns an empty list.
For eg. if I modify a file and add a new class to it, getValues() will return the appropriate class names along with the newly added class. If I restart the IDE, the getValues() returns an empty list. Why is this the case? Should I be doing something more to get the values corresponding to a key? Thanks for your help in advance.