/** * NOTE: this runs in linear time (it scans starting at the * beginning of the list until it finds the first pair with * the specified name). */ public T remove(String name) { int idx = indexOf(name, 0); if(idx != -1) return remove(idx); return null; }
/** * NOTE: this runs in linear time (it scans starting at the * beginning of the list until it finds the first pair with * the specified name). */ public T remove(String name) { int idx = indexOf(name, 0); if(idx != -1) return remove(idx); return null; }
@Override public T put(String key, T value) { int idx = NamedList.this.indexOf(key, 0); if (idx == -1) { NamedList.this.add(key, value); } else { NamedList.this.setVal(idx, value); } return null; }
if (obj instanceof NamedList) { NamedList namedList = (NamedList) obj; int location = namedList.indexOf(s, 0); if (location == -1) namedList.add(s, value); else namedList.setVal(location, value);
/** * Given a SolrQueryResponse replace the DocList if it is in the result. * Otherwise add it to the response * * @since solr 1.4 */ public static void addOrReplaceResults(SolrQueryResponse rsp, SolrDocumentList docs) { NamedList vals = rsp.getValues(); int idx = vals.indexOf( "response", 0 ); if( idx >= 0 ) { log.debug("Replacing DocList with SolrDocumentList " + docs.size()); vals.setVal( idx, docs ); } else { log.debug("Adding SolrDocumentList response" + docs.size()); vals.add( "response", docs ); } }
didx = dl.indexOf(skey, 0);
queryResponse.getResponse().indexOf(QUERY_RESPONSE_NAME, 0), solrDocumentList); queryResponse.getResponseHeader().indexOf(QUERY_TIME_NAME, 0), new Integer(new Long(System.currentTimeMillis() - startTime).intValue())); long highlightEndTime = System.currentTimeMillis(); int paramsIndex = queryResponse.getResponseHeader().indexOf(HEADER_PARAMS_NAME, 0); NamedList<Object> header = null; Object o = queryResponse.getResponseHeader().getVal(paramsIndex); if (o instanceof NamedList) { header = (NamedList<Object>)o; header.setVal(header.indexOf(CommonParams.ROWS, 0), new Integer(rows)); header.setVal(header.indexOf(CommonParams.START, 0), new Long(start));
info = new SimpleOrderedMap(); int idx = info.indexOf("explain",0); if (idx>=0) { info.setVal(idx, explain);
queryResponse.getResponse().indexOf(QUERY_RESPONSE_NAME, 0), solrDocumentList);