Package org.compass.core

Examples of org.compass.core.CompassSession.find()


 
  public void removeItem(Item item) {
    CompassSession compassSession = compass.openSession();
    CompassTransaction compassTransaction = compassSession.beginTransaction();
    String query = "+itemId:" + item.getItemId().toString();
    CompassHits hits = compassSession.find(query);
    Iterator<?> iterator = hits.detach().iterator();
    while (iterator.hasNext()) {
      DefaultCompassHit defaultCompassHit = (DefaultCompassHit) iterator.next();
      compassSession.delete(defaultCompassHit.getData());
    }
View Full Code Here


   
    CompassSession compassSession = compass.openSession();
    CompassTransaction compassTransaction = compassSession.beginTransaction();

    String query = "+itemId:" + master.getItemId().toString();
    CompassHits hits = compassSession.find(query);
    Iterator<?> iterator = hits.detach().iterator();
    while (iterator.hasNext()) {
      DefaultCompassHit defaultCompassHit = (DefaultCompassHit) iterator.next();
      compassSession.delete(defaultCompassHit.getData());
    }
View Full Code Here

 
  public void removeContent(Content content) {
    CompassSession compassSession = compass.openSession();
    CompassTransaction compassTransaction = compassSession.beginTransaction();
    String query = "+contentId:" + content.getContentId().toString();
    CompassHits hits = compassSession.find(query);
    Iterator<?> iterator = hits.detach().iterator();
    while (iterator.hasNext()) {
      DefaultCompassHit defaultCompassHit = (DefaultCompassHit) iterator.next();
      compassSession.delete(defaultCompassHit.getData());
    }
View Full Code Here

    }
    CompassSession compassSession = compass.openSession();
    CompassTransaction compassTransaction = compassSession.beginTransaction();

    String query = "+contentId:" + master.getContentId().toString();
    CompassHits hits = compassSession.find(query);
    Iterator<?> iterator = hits.detach().iterator();
    while (iterator.hasNext()) {
      DefaultCompassHit defaultCompassHit = (DefaultCompassHit) iterator.next();
      compassSession.delete(defaultCompassHit.getData());
    }
View Full Code Here

    if (!isShareInventory) {
      query += " +siteDomainId:" + siteDomainId;
    }
    query += " +(" + criteria + ")";
//query = criteria;
    CompassHits hits = compassSession.find(query);
    result.setHitCount(hits.getLength());
   
    int start = (pageNum - 1) * pageSize;
    int end = start + pageSize - 1;
    Vector<Object> queryHits = new Vector<Object>();
View Full Code Here

    public <T extends Model> Page<T> search(String queryString,PageCriteria pageCriteria,Class<T> modelClass){
        List<T> result =  new ArrayList<>();
        Compass compass = compassTemplate.getCompass();
        CompassSession session=compass.openSession();
        CompassHits hits=  session.find(queryString);
        LOG.info("命中:"+hits.getLength());
        LOG.info("查询字符串:"+queryString);
        if(pageCriteria!=null){
            int start = (pageCriteria.getPage()-1) * pageCriteria.getSize();
            int end = (pageCriteria.getPage()-1) * pageCriteria.getSize() + pageCriteria.getSize();
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.