Ironically just after I posted my reply I had a brainwave and believe i have found a solution. I sort of plugged this java into the 'webapp' version of terrier so probably need to do a clean version of terier on Java to make a better solution but below are the relevent lines of code
Manager queryingManager = (Manager)application.getAttribute("terrier.jsp.manager"
SearchRequest srq = queryingManager.newSearchRequest("results.jsp.query", query);
srq.setControl("end", String.valueOf(iStart + NUM_RESULTS_PER_PAGE -1));
ResultSet rs = srq.getResultSet();
QueryExpansion qexpan = new QueryExpansion();
Its far from the best solution I imagine and sends it out in a string with a few numbers however should be a guide to anyone attempting a similar thing. Also not 100% sure its giving the right answers at the moment but they look pretty good
Unfortunately it looks like the site has converted ' ) : ' (remove the space) at the end of my code lines as emojis. Not sure how to add 'just code' into my comments but hopefully people trying to replicate can work it out :p
Edited 1 time(s). Last edit at 09/14/2017 11:47AM by Jeremy.