Package org.jzkit.search.provider.iface

Examples of org.jzkit.search.provider.iface.Searchable


    app_context = new ClassPathXmlApplicationContext( "TestApplicationContext.xml" );
    SearchableFactory sf = (org.jzkit.search.provider.iface.SearchableFactory) app_context.getBean("SearchableFactory");

    IRServiceDescriptor descriptor = new IRServiceDescriptor("proto=SOLR,code=k-int-solr,baseURL=http://dev.k-int.com:8080/solr/select,shortname=SOLR,longname=k-int SOLR Test,defaultRecordSyntax=usmarc,defaultElementSetName=F,recordArchetypes(Default)=solr::F,QueryType=SOLR-STD,fieldList(F)='id,name,popularity',fieldList(B)='id,name',fieldList(Default)='id,name,popularity'");

    Searchable s = sf.create(descriptor);

    if ( s != null ) {
      org.jzkit.search.util.QueryModel.CQLString.CQLString qm = new org.jzkit.search.util.QueryModel.CQLString.CQLString("name=dell");

      // Create a query
      IRQuery query = new IRQuery(qm,"Default");

      IRResultSet result = s.evaluate(query);
      result.waitForStatus(IRResultSetStatus.COMPLETE|IRResultSetStatus.FAILURE,0);
      Enumeration e = new org.jzkit.search.util.ResultSet.ReadAheadEnumeration(result, new ArchetypeRecordFormatSpecification("Default"));
      for ( int i=0; ( ( e.hasMoreElements() ) && ( i < 20 ) ); i++) {
        Object o = e.nextElement();
        System.err.println(o);
View Full Code Here


    Z3950QueryModel zqm = Type1QueryModelBuilder.buildFrom(app_context, query.query, "utf-8");
    System.err.println("result of conversion back :"+zqm.toInternalQueryModel(app_context));
   

    System.err.println("Obtain instance from factory");
    Searchable s = factory.newSearchable();
    s.setApplicationContext(app_context);

    System.err.println("Evaluate query...");
    IRResultSet result = s.evaluate(query);

    System.err.println("Waiting for result set to complete, current status = "+result.getStatus());
    // Wait without timeout until result set is complete or failure
    result.waitForStatus(IRResultSetStatus.COMPLETE|IRResultSetStatus.FAILURE,0);
View Full Code Here

TOP

Related Classes of org.jzkit.search.provider.iface.Searchable

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.