Worked out debug and options for getPagesByTerm