Create indexes of categories based on query string