Package org.compass.core

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


                                .setAliases(aliases).addSort(
                                        "searchOrder",
                                        SortPropertyType.INT,
                                        SortDirection.REVERSE).hits();

                        return hits.detach(start, max_num_hits);
                    }
                });
        log.debug("Search " + searchString + " alias "
                + ArrayUtils.toString(aliases) + " hits "
                + hits.getLength());
View Full Code Here


  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

    result.setHitCount(hits.getLength());
   
    int start = (pageNum - 1) * pageSize;
    int end = start + pageSize - 1;
    Vector<Object> queryHits = new Vector<Object>();
    Iterator<?> iterator = hits.detach().iterator();
    int pos = -1;
    while (iterator.hasNext()) {
      pos++;
      DefaultCompassHit defaultCompassHit = (DefaultCompassHit) iterator.next();
      if (pos < start) {
View Full Code Here

            int max = MapUtils.getIntValue(options, "max");
            int offset = MapUtils.getIntValue(options, "offset");
            int low = offset;

            Object collectedHits =  hitCollector.collect(hits,options);
            CompassDetachedHits compassDetachedHits = hits.detach(low,max);
            Object searchResult = searchResultFactory.buildSearchResult(hits, collectedHits, compassDetachedHits, options);

            doWithHighlighter(collectedHits, hits, searchResult, options);

            Object suggestOption = options.get("suggestQuery");
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.