Package org.apache.solr.common.util

Examples of org.apache.solr.common.util.SimpleOrderedMap


  public void finishStage(ResponseBuilder rb) {
  }

    private static void fillResponse(BrowseRequest req,BrowseResult res,SolrQueryResponse solrRsp){
   
    NamedList facetFieldList = new SimpleOrderedMap();
    Map<String,FacetAccessible> facetMap = res.getFacetMap();
   
    Set<Entry<String,FacetAccessible>> entries = facetMap.entrySet();
    for (Entry<String,FacetAccessible> entry : entries){
     
      NamedList facetList = new NamedList();
      facetFieldList.add(entry.getKey(), facetList);
      FacetAccessible facetAccessbile = entry.getValue();
      List<BrowseFacet> facets = facetAccessbile.getFacets();
      for (BrowseFacet facet : facets){
        facetList.add(facet.getValue(),facet.getFacetValueHitCount());
      }
    }
   
    NamedList facetResList = new SimpleOrderedMap();
   
    facetResList.add("facet_fields", facetFieldList);
   
    NamedList facetQueryList = new SimpleOrderedMap();
   
    facetResList.add("facet_queries", facetQueryList);
    solrRsp.add( "facet_counts", facetResList );
   
  }
View Full Code Here


    }

    @SuppressWarnings("unchecked")
    public NamedList getStatistics()
    {
        NamedList lst = new SimpleOrderedMap();

        lst.add("rollbacks", rollbackCommands.get());
        lst.add("adds", addCommands.get());
        lst.add("deletesById", deleteByIdCommands.get());
        lst.add("deletesByQuery", deleteByQueryCommands.get());
        lst.add("errors", numErrors.get());
        lst.add("cumulative_adds", addCommandsCumulative.get());
        lst.add("cumulative_deletesById", deleteByIdCommandsCumulative.get());
        lst.add("cumulative_deletesByQuery", deleteByQueryCommandsCumulative.get());
        lst.add("cumulative_errors", numErrorsCumulative.get());
        return lst;
    }
View Full Code Here

    // if someone called this method, benefit of the doubt: assume true
    if (!params.getBool(FacetParams.FACET,true))
      return null;

    facetResponse = new SimpleOrderedMap();
    try {
      facetResponse.add("facet_queries", new SimpleOrderedMap());//getFacetQueryCounts()
      facetResponse.add("facet_fields", new SimpleOrderedMap());
      facetResponse.add("facet_dates"new SimpleOrderedMap());//getFacetDateCounts()
      facetResponse.add("facet_ranges",new SimpleOrderedMap() );//getFacetRangeCounts()

    } catch (Throwable e) {
      LOG.error("getFacetCounts",e);
        throw new SolrException(ErrorCode.SERVER_ERROR, e);
      }
View Full Code Here

    FacetInfo fi = rb._facetInfo;
    if(rb.req.getParams().get("mdrill.crc.key.get",null)!=null)
    {
        rb.rsp.add("mdrill_data", rb.crcvalue);
    }else{
      NamedList fieldCounts = new SimpleOrderedMap();
 
      DistribFieldFacet dff=fi.cross;
 
      int saverecords=dff.offset + dff.limit;
      GroupbyItem[] counts = dff.getPairSorted(saverecords);
      if(dff.recordcount!=null)
      {
          GroupbyItem recordcount=dff.recordcount;
        fieldCounts.add("count", recordcount.toNamedList());
      }
 
      int end = dff.limit < 0 ? counts.length : Math.min(dff.offset + dff.limit, counts.length);
    ArrayList<Object> list=new ArrayList<Object>();

      for (int i=dff.offset; i<end; i++) {
        GroupbyItem item=counts[i];
        list.add(item.toNamedList());
      }
      fieldCounts.add("list", list);
      rb.rsp.add("mdrill_data", fieldCounts);
    }


View Full Code Here

  public URL[] getDocs() {
    return null;
  }

  public NamedList getStatistics() {
    NamedList lst = new SimpleOrderedMap();
    lst.add("coreName", name==null ? "(null)" : name);
    lst.add("startTime", new Date(startTime));
    lst.add("refCount", getOpenCount());
//    lst.add("aliases", getCoreDescriptor().getCoreContainer().getCoreNames(this));
    return lst;
  }
View Full Code Here

  public URL[] getDocs() {
    return null;
  }

  public NamedList getStatistics() {
    NamedList lst = new SimpleOrderedMap();
    lst.add("searcherName", name);
    lst.add("numDocs", reader.numDocs());
    lst.add("maxDoc", reader.maxDoc());
    lst.add("reader", reader.toString());
    lst.add("readerDir", reader.directory());
    lst.add("indexVersion", reader.getVersion());
    lst.add("openedAt", new Date(openTime));
    if (registerTime!=0) lst.add("registeredAt", new Date(registerTime));
    lst.add("warmupTime", warmupTime);
    return lst;
  }
View Full Code Here

  }
  public URL[] getDocs() {
    return null;
  }
  public NamedList getStatistics() {
    NamedList stats = new SimpleOrderedMap();
    CacheEntry[] entries = FieldCache.DEFAULT.getCacheEntries();
    stats.add("entries_count", entries.length);
    for (int i = 0; i < entries.length; i++) {
      CacheEntry e = entries[i];
      stats.add("entry#" + i, e.toString());
    }

    Insanity[] insanity = checker.check(entries);

    stats.add("insanity_count", insanity.length);
    for (int i = 0; i < insanity.length; i++) {

      /** RAM estimation is both CPU and memory intensive... we don't want to do it unless asked.
      // we only estimate the size of insane entries
      for (CacheEntry e : insanity[i].getCacheEntries()) {
        // don't re-estimate if we've already done it.
        if (null == e.getEstimatedSize()) e.estimateSize();
      }
      **/
     
      stats.add("insanity#" + i, insanity[i].toString());
    }
    return stats;
  }
View Full Code Here

    // wait until STAGE_GET_FIELDS
    // so that "result" is already stored in the response (for aesthetics)

    StatsInfo si = rb._statsInfo;

    NamedList stats = new SimpleOrderedMap();
    NamedList stats_fields = new SimpleOrderedMap();
    stats.add("stats_fields", stats_fields);
    for (String field : si.statsFields.keySet()) {
      NamedList stv = si.statsFields.get(field).getStatsValues();
      if ((Long) stv.get("count") != 0) {
        stats_fields.add(field, stv);
      } else {
        stats_fields.add(field, null);
      }
    }

    rb.rsp.add("stats", stats);
View Full Code Here

       
    String debug = getParam(req, CommonParams.DEBUG_QUERY, params.debugQuery);

    NamedList dbg = null;
    if (debug!=null) {
      dbg = new SimpleOrderedMap();

      /* userQuery may have been pre-processes .. expose that */
      dbg.add("rawquerystring", req.getQueryString());
      dbg.add("querystring", userQuery);

View Full Code Here

    String debug = req.getParams().get(CommonParams.DEBUG_QUERY);

    NamedList dbg = null;
    if (debug!=null) {
      dbg = new SimpleOrderedMap();

      SolrIndexSearcher searcher = req.getSearcher();
      IndexSchema schema = req.getSchema();

      boolean explainStruct
View Full Code Here

TOP

Related Classes of org.apache.solr.common.util.SimpleOrderedMap

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.