Tabnine Logo
NamedList.iterator
Code IndexAdd Tabnine to your IDE (free)

How to use
iterator
method
in
org.apache.solr.common.util.NamedList

Best Java code snippets using org.apache.solr.common.util.NamedList.iterator (Showing top 13 results out of 315)

origin: BroadleafCommerce/BroadleafCommerce

@Override
@SuppressWarnings("unchecked")
public Map<String, SolrJSONFacet> resolveJSONFacetResponse(QueryResponse response) {
  Map<String, SolrJSONFacet> jsonFacetMap = new HashMap<>();
  NamedList facetResponse = (NamedList) response.getResponse().get("facets");
  if (facetResponse != null) {
    Iterator<Map.Entry<String, Object>> facetIterator = facetResponse.iterator();
    while (facetIterator.hasNext()) {
      Map.Entry<String, Object> entry = facetIterator.next();
      if (NamedList.class.isAssignableFrom(entry.getValue().getClass())) {
        jsonFacetMap.put(entry.getKey(), resolveJSONFacet((NamedList) entry.getValue()));
      }
    }
  }
  return jsonFacetMap;
}
origin: BroadleafCommerce/BroadleafCommerce

@SuppressWarnings("unchecked")
protected SolrJSONFacet resolveJSONFacet(NamedList facetNamedList) {
  SolrJSONFacet jsonFacet = new SolrJSONFacet();
  Iterator<Map.Entry<String, Object>> iterator = facetNamedList.iterator();
  while (iterator.hasNext()) {
    Map.Entry<String, Object> entry = iterator.next();
    if (entry.getValue() != null) {
      if (NamedList.class.isAssignableFrom(entry.getValue().getClass())) {
        jsonFacet.getMap().put(entry.getKey(), resolveJSONFacet((NamedList) entry.getValue()));
      } else if (List.class.isAssignableFrom(entry.getValue().getClass())) {
        jsonFacet.getMap().put(entry.getKey(), resolveJSONFacetList((List<NamedList>) entry.getValue()));
      } else {
        jsonFacet.getMap().put(entry.getKey(), String.valueOf(entry.getValue()));
      }
    }
  }
  return jsonFacet;
}
origin: flaxsearch/BioSolr

/**
 * Convert a list of facets into a map, keyed by the facet term. 
 * @param facetValues the facet values.
 * @return a map of term - value for each entry.
 */
private Map<String, Integer> extractFacetValues(NamedList<Integer> facetValues) {
  Map<String, Integer> facetMap = new LinkedHashMap<>();
  for (Iterator<Entry<String, Integer>> it = facetValues.iterator(); it.hasNext(); ) {
    Entry<String, Integer> entry = it.next();
    if (entry.getValue() > 0) {
      facetMap.put(entry.getKey(), entry.getValue());
    }
  }
  
  return facetMap;
}

origin: org.dspace.dependencies.solr/dspace-solr-core

Class clazz = bean.getClass();
Method[] methods = clazz.getMethods();
Iterator<Map.Entry<String, Object>> iterator = initArgs.iterator();
while (iterator.hasNext()) {
 Map.Entry<String, Object> entry = iterator.next();
origin: com.rbmhtechnology.vind/solr-suggestion-handler

list_of_facet_lists.addLast(l);
for(String field : fields) {
  Iterator<Map.Entry> iter = ((NamedList)facets.get(field)).iterator();
  while(iter.hasNext()) {
    Map.Entry<String, NamedList<Object>> entry = iter.next();
origin: org.dspace.dependencies.solr/dspace-solr-cell

if (configDateFormats != null && configDateFormats.size() > 0) {
 dateFormats = new HashSet<String>();
 while (configDateFormats.iterator().hasNext()) {
  String format = (String) configDateFormats.iterator().next();
  log.info("Adding Date Format: " + format);
  dateFormats.add(format);
origin: org.apache.solr/solr-solrj

Iterator<Map.Entry<String,Object>> routeIter = routes.iterator();
while (routeIter.hasNext()) {
 Map.Entry<String,Object> next = routeIter.next();
origin: com.rbmhtechnology.vind/backend-solr

    Spliterators.spliteratorUnknownSize(response.getFacetPivot().iterator(), Spliterator.ORDERED),
    false);
pivotFacets.forEach(pivotFacet -> {
origin: com.hynnet/solr-solrj

Iterator<Map.Entry<String,Object>> routeIter = routes.iterator();
while (routeIter.hasNext()) {
 Map.Entry<String,Object> next = routeIter.next();
origin: com.hynnet/solr-solrj

 /**
  * @see #write(Map)
  */
 @SuppressWarnings("unchecked")
 public void write(NamedList<?> val) {
  this.startObject();
  int sz = val.size();
  boolean first = true;
  Iterator i$ = val.iterator();
  while (i$.hasNext()) {
   Map.Entry<String, ?> entry = (Map.Entry<String, ?>) i$.next();
   if (first) {
    first = false;
   } else {
    this.writeValueSeparator();
   }
   if (sz > 1) {
    this.indent();
   }
   this.writeString(entry.getKey());
   this.writeNameSeparator();
   this.write(entry.getValue());
  }
  this.endObject();
 }
}
origin: org.alfresco/alfresco-repository

protected void pingSolr()
{
  ModifiableSolrParams params = new ModifiableSolrParams();
  params.set("qt", "/admin/cores");
  params.set("action", "STATUS");
  
  QueryResponse response = basicQuery(params);
  if(response != null && response.getStatus() == 0)
  {
    NamedList<Object> results = response.getResponse();
    @SuppressWarnings("unchecked")
    NamedList<Object> report = (NamedList<Object>)results.get("status");
    Iterator<Map.Entry<String, Object>> coreIterator = report.iterator();
    List<String> cores = new ArrayList<String>(report.size());
    while(coreIterator.hasNext())
    {
      Map.Entry<String, Object> core = coreIterator.next();
      cores.add(core.getKey());
    }
    
    registerCores(cores);
    setSolrActive(true);
  }
  else
  {
    setSolrActive(false);
  }
}
 
origin: Alfresco/alfresco-repository

protected void pingSolr()
{
  ModifiableSolrParams params = new ModifiableSolrParams();
  params.set("qt", "/admin/cores");
  params.set("action", "STATUS");
  
  QueryResponse response = basicQuery(params);
  if(response != null && response.getStatus() == 0)
  {
    NamedList<Object> results = response.getResponse();
    @SuppressWarnings("unchecked")
    NamedList<Object> report = (NamedList<Object>)results.get("status");
    Iterator<Map.Entry<String, Object>> coreIterator = report.iterator();
    List<String> cores = new ArrayList<String>(report.size());
    while(coreIterator.hasNext())
    {
      Map.Entry<String, Object> core = coreIterator.next();
      cores.add(core.getKey());
    }
    
    registerCores(cores);
    setSolrActive(true);
  }
  else
  {
    setSolrActive(false);
  }
}
 
origin: org.apache.solr/solr-cell

if (configDateFormats != null && configDateFormats.size() > 0) {
 dateFormats = new HashSet<>();
 Iterator<Map.Entry> it = configDateFormats.iterator();
 while (it.hasNext()) {
  String format = (String) it.next().getValue();
org.apache.solr.common.utilNamedListiterator

Javadoc

Support the Iterable interface

Popular methods of NamedList

  • get
    Gets the value for the first instance of the specified name found starting at the specified index.
  • add
    Adds a name/value pair to the end of the list.
  • size
    The total number of name/value pairs
  • <init>
    Creates a NamedList instance containing the "name,value" pairs contained in the Entry[]. Modifying t
  • getName
    The name of the pair at the specified List index
  • getVal
    The value of the pair at the specified List index
  • remove
    NOTE: this runs in linear time (it scans starting at the beginning of the list until it finds the fi
  • toString
  • getAll
    Gets the values for the the specified name
  • getBooleanArg
    Used for getting a boolean argument from a NamedList object. If the name is not present, returns nul
  • addAll
    Appends the elements of the given NamedList to this one.
  • clone
    Makes a shallow copy of the named list.
  • addAll,
  • clone,
  • indexOf,
  • forEach,
  • setVal,
  • toSolrParams,
  • asMap,
  • equals,
  • killAll

Popular in Java

  • Reactive rest calls using spring rest template
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now