Package org.compass.core

Examples of org.compass.core.CompassHits.data()


        compassTemplate.execute(new CompassCallbackWithoutResult() {
            @Override
            protected void doInCompassWithoutResult(CompassSession compassSession) throws CompassException {
                CompassHits hits = compassSession.find("Matt");
                assertEquals(1, hits.length());
                assertEquals("Matt", ((User) hits.data(0)).getFirstName());
                assertEquals("Matt", hits.resource(0).getValue("firstName"));
            }
        });

        // test mirroring
View Full Code Here


        compassTemplate.execute(new CompassCallbackWithoutResult() {
            @Override
            protected void doInCompassWithoutResult(CompassSession compassSession) throws CompassException {
                CompassHits hits = compassSession.find("MattX");
                assertEquals(1, hits.length());
                assertEquals("MattX", ((User) hits.data(0)).getFirstName());
            }
        });
    }
}
View Full Code Here

            int end = (pageCriteria.getPage()-1) * pageCriteria.getSize() + pageCriteria.getSize();
            if (end > hits.getLength()) {
                end = hits.getLength();
            }
            for(int i=start;i<end;i++){
                if(hits.data(i).getClass()==modelClass){
                    //T t=(T)hits.data(i);
                    try{
                        T t=hightlight(modelClass,hits,i);
                        result.add(t);
                    }catch(Exception e){
View Full Code Here

                    //T t=(T)hits.data(i);
                    try{
                        T t=hightlight(modelClass,hits,i);
                        result.add(t);
                    }catch(Exception e){
                        result.add((T)hits.data(i));
                    }
                }
            }
        }else{
            for(int i=0;i<hits.getLength();i++){
View Full Code Here

                    }
                }
            }
        }else{
            for(int i=0;i<hits.getLength();i++){
                if(hits.data(i).getClass()==modelClass){
                    //T t=(T)hits.data(i);
                    try{
                        T t=hightlight(modelClass,hits,i);
                        result.add(t);
                    }catch(Exception e){
View Full Code Here

                    //T t=(T)hits.data(i);
                    try{
                        T t=hightlight(modelClass,hits,i);
                        result.add(t);
                    }catch(Exception e){
                        result.add((T)hits.data(i));
                    }
                }
            }
        }
        session.close();
View Full Code Here

      CompassSearchSession session = compass.openSearchSession();
      try {
        CompassHits hits = session.find(suchKriterium);
        System.out.println("Hits");
        for (int i = 0; i < hits.getLength(); i++) {
          archivalien.add((Archivale) hits.data(i));
          System.out.println(hits.hit(i).score() + " "
              + hits.hit(i).getHighlightedText());
        }
      } finally {
        session.close();
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.