Package org.terrier.querying

Examples of org.terrier.querying.SearchRequest


   * @param query the query to process
   * @param cParameter double the term frequency normalisation parameter value
   * @param c_set specifies whether the given value for the parameter c should be used.
   */
  public SearchRequest processQuery(String queryId, String query, double cParameter, boolean c_set) {
    SearchRequest srq = queryingManager.newSearchRequest(queryId, query);
   
    if (c_set)
      srq.setControl("c", Double.toString(cParameter));
    srq.addMatchingModel(mModel, wModel);
    srq.setControl("qemodel", qeModel);
    srq.setControl("qe", "on");
    srq.setControl("c_set", ""+c_set);

    if(logger.isInfoEnabled())
      //logger.info("processing query " + queryId + " '"+ query + "'");
    matchingCount++;
    queryingManager.runPreProcessing(srq);
    queryingManager.runMatching(srq);
    final String cpost = ApplicationSetup.getProperty("c.post", null);
    if (cpost != null)
    {
      srq.setControl("c", cpost);
      srq.setControl("c_set", "true");
    }
    //else the c control is left as is. Ie if c_set is not true, then the weighting model's
    //default value is kept
    queryingManager.runPostProcessing(srq);
    queryingManager.runPostFilters(srq);
View Full Code Here


   * @param query org.terrier.structures.Query the query to process.
   * @param cParameter double the value of the parameter to use.
   * @param c_set A boolean variable indicating if cParameter has been specified.
   */
  protected void processQueryAndWrite(String queryId, String query, double cParameter, boolean c_set) {
    SearchRequest srq = processQuery(queryId, query, cParameter, c_set);
    if (resultFile == null) {
      method = ApplicationSetup.getProperty("trec.runtag", queryingManager.getInfo(srq));
      String prefix = method +
        "_d_"+ApplicationSetup.getProperty("expansion.documents", "3")+
        "_t_"+ApplicationSetup.getProperty("expansion.terms", "10");
View Full Code Here

   * @param queryId String the query identifier to use.
   * @param query String the query to process.
   * @param cParameter double the value of the parameter to use.
   */
  public void processQuery(String queryId, String query, double cParameter) {
    SearchRequest srq = queryingManager.newSearchRequest(queryId, query);
    srq.setControl("c", Double.toString(cParameter));
    srq.addMatchingModel(mModel, wModel);
    matchingCount++;
    queryingManager.runPreProcessing(srq);
    queryingManager.runMatching(srq);
    queryingManager.runPostProcessing(srq);
    queryingManager.runPostFilters(srq);
View Full Code Here

   */
  public void processQuery(String queryId, String query, double cParameter) {
 
              //  System.out.println(" Query id: "+queryId+ " Query : "+query+" c parameter : "+cParameter);
            
                SearchRequest srq = queryingManager.newSearchRequest(queryId, query);
    srq.setControl("c", Double.toString(cParameter));
    srq.addMatchingModel(mModel, wModel);
    matchingCount++;
    queryingManager.runPreProcessing(srq);
    queryingManager.runMatching(srq);
    queryingManager.runPostProcessing(srq);
    queryingManager.runPostFilters(srq);
View Full Code Here

   *            A boolean variable indicating if cParameter has been
   *            specified.
   */
  protected void processQueryAndWrite(String queryId, String query,
      double cParameter, boolean c_set) {
    SearchRequest srq = processQuery(queryId, query, cParameter, c_set);

    if (resultFile == null) {
      method = ApplicationSetup.getProperty("trec.runtag", queryingManager.getInfo(srq));
      if (queryexpansion)
        method = method +
View Full Code Here

      query = query.replaceAll("\\.", " ");
    }

    //if (logger.isInfoEnabled())
      //logger.info(queryId + " : " + query);
    SearchRequest srq = queryingManager.newSearchRequest(queryId, query);
    initSearchRequestModification(queryId, srq);
    String c = null;
    if (c_set) {
      srq.setControl("c", Double.toString(cParameter));
    } else if ((c = ApplicationSetup.getProperty("trec.c", null)) != null) {
      srq.setControl("c", c);
    }
    c = null;
    if ((c = srq.getControl("c")).length() > 0) {
      c_set = true;
    }
    srq.setControl("c_set", "" + c_set);

    srq.addMatchingModel(mModel, wModel);
   
    if (queryexpansion) {
      //if (srq.getControl("qemodel").length() == 0)
      srq.setControl("qemodel", defaultQEModel);
      srq.setControl("qe", "on");
    }
   
    preQueryingSearchRequestModification(queryId, srq);
    ResultSet rs = resultsCache.checkCache(srq);
    if (rs != null)
View Full Code Here

   * @param cParameter double the value of the parameter to use.
   */
  public void processQuery(String queryId, String query, double cParameter) {
 
                querys=query;
                SearchRequest srq = queryingManager.newSearchRequest(queryId, query);
    srq.setControl("c", Double.toString(cParameter));
    srq.addMatchingModel(mModel, wModel);
    matchingCount++;
    queryingManager.runPreProcessing(srq);
    queryingManager.runMatching(srq);
    queryingManager.runPostProcessing(srq);
    queryingManager.runPostFilters(srq);
View Full Code Here

   * @param queryId String the query identifier to use.
   * @param query String the query to process.
   * @param cParameter double the value of the parameter to use.
   */
  public void processQuery(String queryId, String query, double cParameter) {
    SearchRequest srq = queryingManager.newSearchRequest(queryId, query);
    srq.setControl("c", Double.toString(cParameter));
    srq.addMatchingModel(mModel, wModel);
    matchingCount++;
    queryingManager.runPreProcessing(srq);
    queryingManager.runMatching(srq);
    queryingManager.runPostProcessing(srq);
    queryingManager.runPostFilters(srq);
View Full Code Here

   * @param queryId String the query identifier to use.
   * @param query String the query to process.
   * @param cParameter double the value of the parameter to use.
   */
  public void processQuery(String queryId, String query, double cParameter) {
    SearchRequest srq = queryingManager.newSearchRequest(queryId, query);
    srq.setControl("c", Double.toString(cParameter));
    srq.addMatchingModel(mModel, wModel);
    matchingCount++;
    queryingManager.runPreProcessing(srq);
    queryingManager.runMatching(srq);
    queryingManager.runPostProcessing(srq);
    queryingManager.runPostFilters(srq);
View Full Code Here

   * @param query String the query to process.
   * @param cParameter double the value of the parameter to use.
   */
  public void processQuery(String queryId, String query, double cParameter) {
             //   System.out.println("reached sim1 processquery ");
    SearchRequest srq = queryingManager.newSearchRequest(queryId, query);
    srq.setControl("c", Double.toString(cParameter));
    srq.addMatchingModel(mModel, wModel);
    matchingCount++;
    queryingManager.runPreProcessing(srq);
    queryingManager.runMatching(srq);
    queryingManager.runPostProcessing(srq);
    queryingManager.runPostFilters(srq);
View Full Code Here

TOP

Related Classes of org.terrier.querying.SearchRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.