Function getSearchIndexFromContext