Examples of QueryModel


Examples of org.jzkit.search.util.QueryModel

    System.err.println("Internal Model using RPN Visitor = "+org.jzkit.search.util.QueryModel.PrefixString.PrefixQueryVisitor.toPQF(imrn));
  }

  public void testSimpleInternal() throws Exception {
    System.err.println("\n\ntestSimpleInternal\n\n");
    QueryModel qm = InternalModelRootNode.createInstanceFromClasspathFile("/DefaultQueryModel.xml");
    System.err.println("Result of parse = "+qm.toString());
    InternalModelRootNode imrn = qm.toInternalQueryModel(app_context);
    System.err.println("Internal Model = "+imrn);
    System.err.println("Internal Model using RPN Visitor = "+org.jzkit.search.util.QueryModel.PrefixString.PrefixQueryVisitor.toPQF(imrn));
  }
View Full Code Here

Examples of org.jzkit.search.util.QueryModel

    System.err.println("Internal Model using RPN Visitor = "+org.jzkit.search.util.QueryModel.PrefixString.PrefixQueryVisitor.toPQF(imrn));
  }

  public void testTemplateBasedQueryFactory() throws Exception {
    System.err.println("\n\ntestTemplateBasedQueryFactory\n\n");
    QueryModel qm = InternalModelRootNode.createInstanceFromClasspathFile("/DefaultQueryModel.xml");
    System.err.println("Result of parse = "+qm.toString()); System.err.println("Internal Model = "+qm.toInternalQueryModel(app_context).toString());
    Map values = new HashMap();
    values.put("query.SubjectCriteria.term","Sports");
    values.put("query.PlaceCriteria.term","Sheffield");
    InternalModelRootNode qm2 = TemplateBasedQueryFactory.visit((InternalModelRootNode)qm,values);
    System.err.println("New Internal Model = "+qm2.toString());
View Full Code Here

Examples of org.jzkit.search.util.QueryModel

    System.err.println("Internal Model using RPN Visitor = "+org.jzkit.search.util.QueryModel.PrefixString.PrefixQueryVisitor.toPQF(qm2));
  }

  public void testAdvancedTemplateBasedQueryFactory() throws Exception {
    System.err.println("\n\nadvancedTestTemplateBasedQueryFactory\n\n");
    QueryModel qm = InternalModelRootNode.createInstanceFromClasspathFile("/DefaultQueryModel.xml");
    System.err.println("Result of parse = "+qm.toString());
    System.err.println("Internal Model = "+qm.toInternalQueryModel(app_context).toString());
    Map values = new HashMap();
    values.put("query.SubjectCriteria.term","Sports \"and a phrase\" Other Term \"And another phrase\"");
    values.put("query.SubjectCriteria.relation","Like");
    values.put("query.SubjectCriteria.truncation","RightAndLeft");
    values.put("query.PlaceCriteria.term","Sheffield");
View Full Code Here

Examples of org.jzkit.search.util.QueryModel

    System.err.println("Internal Model using RPN Visitor = "+org.jzkit.search.util.QueryModel.PrefixString.PrefixQueryVisitor.toPQF(qm2));
  }

  public void testQuotedStrings() throws Exception {
    System.err.println("\n\ntestQuotedStrings\n\n");
    QueryModel qm = InternalModelRootNode.createInstanceFromClasspathFile("/DefaultQueryModel.xml");
    System.err.println("Result of parse = "+qm.toString());
    System.err.println("Internal Model = "+qm.toInternalQueryModel(app_context).toString());
    Map values = new HashMap();
    values.put("query.SubjectCriteria.term","Sports \\\"and a phrase\\\" Other Term \\\"And another phrase\\\"");
    InternalModelRootNode qm2 = TemplateBasedQueryFactory.visit((InternalModelRootNode)qm,values);
    System.err.println("New Internal Model = "+qm2.toString());
    String new_rpn = org.jzkit.search.util.QueryModel.PrefixString.PrefixQueryVisitor.toPQF(qm2);
View Full Code Here

Examples of org.jzkit.search.util.QueryModel

    // }
  }

  public void testPassthrough() throws Exception {
    System.err.println("\n\ntestPassthrough\n\n");
    QueryModel qm = InternalModelRootNode.createInstanceFromClasspathFile("/DefaultQueryModel.xml");
    System.err.println("Result of parse = "+qm.toString());
    System.err.println("Internal Model = "+qm.toInternalQueryModel(app_context).toString());
    Map values = new HashMap();
    values.put("query.SubjectCriteria.multiTermOp","PASSTHRU");
    values.put("query.SubjectCriteria.term","Sports \"and a phrase\" Other Term \"And another phrase\"");
    InternalModelRootNode qm2 = TemplateBasedQueryFactory.visit((InternalModelRootNode)qm,values);
    System.err.println("New Internal Model = "+qm2.toString());
View Full Code Here

Examples of org.jzkit.search.util.QueryModel

    log.debug("getResultsPageFor (Landscape Str):"+landscape_str+" mt:"+model_type+" qs:"+query_string+" ds:"+display_spec+" rfs:"+rfs);

    StatelessSearchResultsPageDTO result = null;
    CachedSearchSession cached_search_session = null;
    QueryModel model = null;
    String qryid = landscape_str+":"+query_string;

     // If we have been given a result set ID
    if ( result_set_id != null ) {
      log.debug("got result set id "+result_set_id);
View Full Code Here

Examples of org.jzkit.search.util.QueryModel

    // Here we need to get an instance of CQLQuery.. So if thats not what we have been passed,
    // this is the place to create one.
    log.fine("Class of IRQuery: "+q.getQueryModel().getClass().getName());

    CQLString cql_string = null;
    QueryModel qm = q.getQueryModel();

    if ( qm instanceof CQLString )
      cql_string = (CQLString)qm;
    else
      cql_string = CQLBuilder.buildFrom(qm, ctx);
View Full Code Here

Examples of org.jzkit.search.util.QueryModel

              // Is there a profile to try and apply for this repository?
              if ( subq == null ) {
                String profile_name = service_id.substring(service_id.lastIndexOf(':')+1,service_id.length());

                QueryModel adapted_query_model = null;

                if ( ( profile_name != null ) && ( !profile_name.equals("null") ) && ( profile_name.length() > 0 ) ) {
                  log.debug("Processing profile "+profile_name);
 
                  // This is where we call the query rewrite service to make a query conformant to the profile needed
View Full Code Here

Examples of org.jzkit.search.util.QueryModel.QueryModel

    {
      String name = servers.elementAt(i);
      collection_ids.add(name);
    }

    QueryModel qm = new PrefixString(query);

    // get hold of JZKit SearchSession
    StatelessQueryService sqs = getQueryService(srvContext);

    LandscapeSpecification landscape = new SimpleLandscapeSpecification( collection_ids );
View Full Code Here

Examples of org.jzkit.search.util.QueryModel.QueryModel

  public void search(BackendSearchDTO bsr) {

    log.debug("JZKitBackend::search "+this.hashCode());

    // QueryModel qm = new PrefixString("@attrset bib-1 @attr 1=4 science");
    QueryModel qm = new org.jzkit.z3950.QueryModel.Type1QueryModel((RPNQuery_type)(bsr.query.o));

    try {
      StatelessQueryService sqs = (StatelessQueryService) ctx.getBean("StatelessQueryService");
      String query_id = null;
      LandscapeSpecification landscape = new SimpleLandscapeSpecification(bsr.database_names);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.