@Override public Manager fromIndex(IndexRef ref) { Index index = IndexFactory.of(ref); assert index != null; return new LocalManager(index); }
Model wmodel = getWeightingModel(rq); final String param = rq.getControl("c"); if (rq.getControl("c_set").equals("true") && param.length() > 0)
/** Construct a Manager using the specified Index * Throws IllegalArgumentException if the specified index is null * @param _index The index to use in this manage */ public LocalManager(Index _index) { if (_index == null) throw new IllegalArgumentException("Null index specified to manager. Did the index load?"); this.useThisIndex(_index); this.load_pipeline(); this.load_controls_allowed(); this.load_controls_default(); } /* ----------------------- Initialisation methods --------------------------*/
@Override public SearchRequest newSearchRequest() { Request q = new Request(); if (Defaults_Size >0) setDefaults(q); q.setIndex(this.index); return (SearchRequest)q; } /* (non-Javadoc)
@Override public SearchRequest newSearchRequestFromQuery(String query) { return newSearchRequest(GENERICQUERYID, query); }
@Override public void setProperties(Properties p) { //for(String k : ((Set<String>)p.keySet())) Enumeration<?> e = p.keys(); while (e.hasMoreElements()) { String propertyName = (String)e.nextElement(); String propertyValue = p.getProperty(propertyName); setProperty(propertyName, propertyValue); } }
if (hasAnnotation(p.getClass(), ManagerRequisite.MQT) && ! mqtObtained) throw new IllegalStateException("Process " + p.getInfo() + " required matchingqueryterms, but mqt not yet set for query qid " + rq.getQueryID() + " previousProcess=" + processesDone.toString() + " controls=" + rq.getControls().toString()); if (hasAnnotation(p.getClass(), ManagerRequisite.RAWQUERY) && ! hasRawQuery) throw new IllegalStateException("Process " + p.getInfo() + " required rawquery, but no raw query found for qid " + rq.getQueryID() + " previousProcess=" + processesDone.toString() + " controls=" + rq.getControls().toString()); if (hasAnnotation(p.getClass(), ManagerRequisite.TERRIERQL) && ! hasTerrierQLquery) throw new IllegalStateException("Process " + p.getInfo() + " required TerrierQL query, but no TerrierQL query found for qid " + rq.getQueryID() + " previousProcess=" + processesDone.toString() + " controls=" + rq.getControls().toString()); if (hasAnnotation(p.getClass(), ManagerRequisite.RESULTSET) && ! hasResultSet) throw new IllegalStateException("Process " + p.getInfo() + " required resultset, but none found for qid " + rq.getQueryID() + " previousProcess=" + processesDone.toString() + " controls=" + rq.getControls().toString());
@Override public SearchRequest newSearchRequest() { Request q = new Request(); if (Defaults_Size >0) setDefaults(q); q.setIndex(this.index); return (SearchRequest)q; } /* (non-Javadoc)
@Override public SearchRequest newSearchRequestFromQuery(String query) { return newSearchRequest(GENERICQUERYID, query); }
@Override public void setProperties(Properties p) { //for(String k : ((Set<String>)p.keySet())) Enumeration<?> e = p.keys(); while (e.hasMoreElements()) { String propertyName = (String)e.nextElement(); String propertyValue = p.getProperty(propertyName); setProperty(propertyName, propertyValue); } }
if (hasAnnotation(p.getClass(), ManagerRequisite.MQT) && ! mqtObtained) throw new IllegalStateException("Process " + p.getInfo() + " required matchingqueryterms, but mqt not yet set for query qid " + rq.getQueryID() + " previousProcess=" + processesDone.toString() + " controls=" + rq.getControls().toString()); if (hasAnnotation(p.getClass(), ManagerRequisite.RAWQUERY) && ! hasRawQuery) throw new IllegalStateException("Process " + p.getInfo() + " required rawquery, but no raw query found for qid " + rq.getQueryID() + " previousProcess=" + processesDone.toString() + " controls=" + rq.getControls().toString()); if (hasAnnotation(p.getClass(), ManagerRequisite.TERRIERQL) && ! hasTerrierQLquery) throw new IllegalStateException("Process " + p.getInfo() + " required TerrierQL query, but no TerrierQL query found for qid " + rq.getQueryID() + " previousProcess=" + processesDone.toString() + " controls=" + rq.getControls().toString()); if (hasAnnotation(p.getClass(), ManagerRequisite.RESULTSET) && ! hasResultSet) throw new IllegalStateException("Process " + p.getInfo() + " required resultset, but none found for qid " + rq.getQueryID() + " previousProcess=" + processesDone.toString() + " controls=" + rq.getControls().toString());
@Override public Manager fromIndex(IndexRef ref) { Index index = IndexFactory.of(ref); assert index != null; return new LocalManager(index); }
/** Construct a Manager using the specified Index * Throws IllegalArgumentException if the specified index is null * @param _index The index to use in this manage */ public LocalManager(Index _index) { if (_index == null) throw new IllegalArgumentException("Null index specified to manager. Did the index load?"); this.useThisIndex(_index); this.load_pipeline(); this.load_controls_allowed(); this.load_controls_default(); } /* ----------------------- Initialisation methods --------------------------*/
@Override public SearchRequest newSearchRequest(String QueryID) { Request q = new Request(); if (Defaults_Size >0) setDefaults(q); q.setQueryID(QueryID); q.setIndex(this.index); return (SearchRequest)q; }
Model wmodel = getWeightingModel(rq); final String param = rq.getControl("c"); if (rq.getControl("c_set").equals("true") && param.length() > 0)
@Test(expected=IllegalArgumentException.class) public void testNullIndexException() throws Exception { new LocalManager(null); }
@Override public SearchRequest newSearchRequest(String QueryID) { Request q = new Request(); if (Defaults_Size >0) setDefaults(q); q.setQueryID(QueryID); q.setIndex(this.index); return (SearchRequest)q; }
Model wmodel = getWeightingModel(rq);
public ResultSet retrieve(String query) { StringBuffer sb = new StringBuffer(); sb.append(query); Manager queryingManager = new LocalManager((Index)index); SearchRequest srq = queryingManager.newSearchRequest("query", sb.toString()); srq.setControl(SearchRequest.CONTROL_WMODEL,"DirichletLM"); srq.setOriginalQuery(sb.toString()); queryingManager.runSearchRequest(srq); return ((Request) srq).getResultSet(); }
@Override public SearchRequest newSearchRequest(String QueryID, String query) { Request q = new Request(); if (Defaults_Size >0) setDefaults(q); q.setQueryID(QueryID); q.setIndex(this.index); // try{ // QueryParser.parseQuery(query, q); // } catch (QueryParserException qpe) { // logger.error("Error while parsing the query.",qpe); // } q.setOriginalQuery(query); return q; }