MtasSolrComponentDocument.java.html 22.5 KB
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>MtasSolrComponentDocument.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">MTAS</a> &gt; <a href="index.source.html" class="el_package">mtas.solr.handler.component.util</a> &gt; <span class="el_source">MtasSolrComponentDocument.java</span></div><h1>MtasSolrComponentDocument.java</h1><pre class="source lang-java linenums">package mtas.solr.handler.component.util;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Set;
import java.util.SortedSet;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.common.util.SimpleOrderedMap;
import org.apache.solr.handler.component.ResponseBuilder;
import org.apache.solr.handler.component.SearchComponent;
import org.apache.solr.handler.component.ShardRequest;

import mtas.codec.util.CodecComponent.ComponentDocument;
import mtas.codec.util.CodecComponent.ComponentField;
import mtas.codec.util.CodecComponent.ComponentFields;
import mtas.codec.util.collector.MtasDataCollector;
import mtas.solr.handler.component.MtasSolrSearchComponent;

/**
 * The Class MtasSolrComponentDocument.
 */
public class MtasSolrComponentDocument
    implements MtasSolrComponent&lt;ComponentDocument&gt; {

  /** The Constant log. */
<span class="fc" id="L29">  private static final Log log = LogFactory</span>
<span class="fc" id="L30">      .getLog(MtasSolrComponentDocument.class);</span>

  /** The Constant PARAM_MTAS_DOCUMENT. */
  public static final String PARAM_MTAS_DOCUMENT = MtasSolrSearchComponent.PARAM_MTAS
      + &quot;.document&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_FIELD. */
  public static final String NAME_MTAS_DOCUMENT_FIELD = &quot;field&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_KEY. */
  public static final String NAME_MTAS_DOCUMENT_KEY = &quot;key&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_PREFIX. */
  public static final String NAME_MTAS_DOCUMENT_PREFIX = &quot;prefix&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_TYPE. */
  public static final String NAME_MTAS_DOCUMENT_TYPE = &quot;type&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_REGEXP. */
  public static final String NAME_MTAS_DOCUMENT_REGEXP = &quot;regexp&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_LIST. */
  public static final String NAME_MTAS_DOCUMENT_LIST = &quot;list&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_LIST_REGEXP. */
  public static final String NAME_MTAS_DOCUMENT_LIST_REGEXP = &quot;listRegexp&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_LIST_EXPAND. */
  public static final String NAME_MTAS_DOCUMENT_LIST_EXPAND = &quot;listExpand&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_LIST_EXPAND_NUMBER. */
  public static final String NAME_MTAS_DOCUMENT_LIST_EXPAND_NUMBER = &quot;listExpandNumber&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_IGNORE_REGEXP. */
  public static final String NAME_MTAS_DOCUMENT_IGNORE_REGEXP = &quot;ignoreRegexp&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_IGNORE_LIST. */
  public static final String NAME_MTAS_DOCUMENT_IGNORE_LIST = &quot;ignoreList&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_IGNORE_LIST_REGEXP. */
  public static final String NAME_MTAS_DOCUMENT_IGNORE_LIST_REGEXP = &quot;ignoreListRegexp&quot;;

  /** The Constant NAME_MTAS_DOCUMENT_NUMBER. */
  public static final String NAME_MTAS_DOCUMENT_NUMBER = &quot;number&quot;;

  /**
   * Instantiates a new mtas solr component document.
   */
<span class="fc" id="L78">  public MtasSolrComponentDocument() {</span>
    // do nothing for now
<span class="fc" id="L80">  }</span>

  /*
   * (non-Javadoc)
   * 
   * @see
   * mtas.solr.handler.component.util.MtasSolrComponent#prepare(org.apache.solr.
   * handler.component.ResponseBuilder,
   * mtas.codec.util.CodecComponent.ComponentFields)
   */
  public void prepare(ResponseBuilder rb, ComponentFields mtasFields)
      throws IOException {
<span class="nc" id="L92">    Set&lt;String&gt; ids = MtasSolrResultUtil</span>
<span class="nc" id="L93">        .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_DOCUMENT);</span>
<span class="nc bnc" id="L94" title="All 2 branches missed.">    if (!ids.isEmpty()) {</span>
<span class="nc" id="L95">      int tmpCounter = 0;</span>
<span class="nc" id="L96">      String[] fields = new String[ids.size()];</span>
<span class="nc" id="L97">      String[] keys = new String[ids.size()];</span>
<span class="nc" id="L98">      String[] prefixes = new String[ids.size()];</span>
<span class="nc" id="L99">      String[] types = new String[ids.size()];</span>
<span class="nc" id="L100">      String[] regexps = new String[ids.size()];</span>
<span class="nc" id="L101">      String[] lists = new String[ids.size()];</span>
<span class="nc" id="L102">      Boolean[] listRegexps = new Boolean[ids.size()];</span>
<span class="nc" id="L103">      Boolean[] listExpands = new Boolean[ids.size()];</span>
<span class="nc" id="L104">      int[] listExpandNumbers = new int[ids.size()];</span>
<span class="nc" id="L105">      String[] ignoreRegexps = new String[ids.size()];</span>
<span class="nc" id="L106">      String[] ignoreLists = new String[ids.size()];</span>
<span class="nc" id="L107">      Boolean[] ignoreListRegexps = new Boolean[ids.size()];</span>
<span class="nc" id="L108">      String[] listNumbers = new String[ids.size()];</span>
<span class="nc bnc" id="L109" title="All 2 branches missed.">      for (String id : ids) {</span>
<span class="nc" id="L110">        fields[tmpCounter] = rb.req.getParams().get(</span>
            PARAM_MTAS_DOCUMENT + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_FIELD,
            null);
<span class="nc" id="L113">        keys[tmpCounter] = rb.req.getParams()</span>
<span class="nc" id="L114">            .get(PARAM_MTAS_DOCUMENT + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_KEY,</span>
<span class="nc" id="L115">                String.valueOf(tmpCounter))</span>
<span class="nc" id="L116">            .trim();</span>
<span class="nc" id="L117">        prefixes[tmpCounter] = rb.req.getParams().get(</span>
            PARAM_MTAS_DOCUMENT + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_PREFIX,
            null);
<span class="nc" id="L120">        types[tmpCounter] = rb.req.getParams().get(</span>
            PARAM_MTAS_DOCUMENT + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_TYPE,
            null);
<span class="nc" id="L123">        regexps[tmpCounter] = rb.req.getParams().get(</span>
            PARAM_MTAS_DOCUMENT + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_REGEXP,
            null);
<span class="nc" id="L126">        lists[tmpCounter] = rb.req.getParams().get(</span>
            PARAM_MTAS_DOCUMENT + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_LIST,
            null);
<span class="nc" id="L129">        listRegexps[tmpCounter] = rb.req.getParams().getBool(PARAM_MTAS_DOCUMENT</span>
            + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_LIST_REGEXP, false);
<span class="nc" id="L131">        listExpands[tmpCounter] = rb.req.getParams().getBool(PARAM_MTAS_DOCUMENT</span>
            + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_LIST_EXPAND, false);
<span class="nc" id="L133">        listExpandNumbers[tmpCounter] = rb.req.getParams()</span>
<span class="nc" id="L134">            .getInt(PARAM_MTAS_DOCUMENT + &quot;.&quot; + id + &quot;.&quot;</span>
                + NAME_MTAS_DOCUMENT_LIST_EXPAND_NUMBER, 10);
<span class="nc" id="L136">        ignoreRegexps[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_DOCUMENT</span>
            + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_IGNORE_REGEXP, null);
<span class="nc" id="L138">        ignoreLists[tmpCounter] = rb.req.getParams().get(PARAM_MTAS_DOCUMENT</span>
            + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_IGNORE_LIST, null);
<span class="nc" id="L140">        ignoreListRegexps[tmpCounter] = rb.req.getParams()</span>
<span class="nc" id="L141">            .getBool(PARAM_MTAS_DOCUMENT + &quot;.&quot; + id + &quot;.&quot;</span>
                + NAME_MTAS_DOCUMENT_IGNORE_LIST_REGEXP, false);
<span class="nc" id="L143">        listNumbers[tmpCounter] = rb.req.getParams().get(</span>
            PARAM_MTAS_DOCUMENT + &quot;.&quot; + id + &quot;.&quot; + NAME_MTAS_DOCUMENT_NUMBER,
            null);
<span class="nc" id="L146">        tmpCounter++;</span>
<span class="nc" id="L147">      }</span>
<span class="nc" id="L148">      String uniqueKeyField = rb.req.getSchema().getUniqueKeyField().getName();</span>
<span class="nc" id="L149">      mtasFields.doDocument = true;</span>
<span class="nc" id="L150">      rb.setNeedDocList(true);</span>
<span class="nc bnc" id="L151" title="All 2 branches missed.">      for (String field : fields) {</span>
<span class="nc bnc" id="L152" title="All 4 branches missed.">        if (field == null || field.isEmpty()) {</span>
<span class="nc" id="L153">          throw new IOException(&quot;no (valid) field in mtas document&quot;);</span>
<span class="nc bnc" id="L154" title="All 2 branches missed.">        } else if (!mtasFields.list.containsKey(field)) {</span>
<span class="nc" id="L155">          mtasFields.list.put(field, new ComponentField(uniqueKeyField));</span>
        }
      }
<span class="nc" id="L158">      MtasSolrResultUtil.compareAndCheck(keys, fields, NAME_MTAS_DOCUMENT_KEY,</span>
<span class="nc" id="L159">          NAME_MTAS_DOCUMENT_FIELD, true);</span>
<span class="nc" id="L160">      MtasSolrResultUtil.compareAndCheck(prefixes, fields,</span>
<span class="nc" id="L161">          NAME_MTAS_DOCUMENT_PREFIX, NAME_MTAS_DOCUMENT_FIELD, false);</span>
<span class="nc" id="L162">      MtasSolrResultUtil.compareAndCheck(types, fields, NAME_MTAS_DOCUMENT_TYPE,</span>
<span class="nc" id="L163">          NAME_MTAS_DOCUMENT_FIELD, false);</span>
<span class="nc" id="L164">      MtasSolrResultUtil.compareAndCheck(regexps, fields,</span>
<span class="nc" id="L165">          NAME_MTAS_DOCUMENT_REGEXP, NAME_MTAS_DOCUMENT_FIELD, false);</span>
<span class="nc" id="L166">      MtasSolrResultUtil.compareAndCheck(lists, fields, NAME_MTAS_DOCUMENT_LIST,</span>
<span class="nc" id="L167">          NAME_MTAS_DOCUMENT_FIELD, false);</span>
<span class="nc" id="L168">      MtasSolrResultUtil.compareAndCheck(ignoreRegexps, fields,</span>
<span class="nc" id="L169">          NAME_MTAS_DOCUMENT_IGNORE_REGEXP, NAME_MTAS_DOCUMENT_FIELD, false);</span>
<span class="nc" id="L170">      MtasSolrResultUtil.compareAndCheck(ignoreLists, fields,</span>
<span class="nc" id="L171">          NAME_MTAS_DOCUMENT_IGNORE_LIST, NAME_MTAS_DOCUMENT_FIELD, false);</span>
<span class="nc" id="L172">      MtasSolrResultUtil.compareAndCheck(listNumbers, fields,</span>
<span class="nc" id="L173">          NAME_MTAS_DOCUMENT_NUMBER, NAME_MTAS_DOCUMENT_FIELD, false);</span>
<span class="nc bnc" id="L174" title="All 2 branches missed.">      for (int i = 0; i &lt; fields.length; i++) {</span>
<span class="nc bnc" id="L175" title="All 4 branches missed.">        String key = (keys[i] == null) || (keys[i].isEmpty())</span>
<span class="nc" id="L176">            ? String.valueOf(i) + &quot;:&quot; + fields[i] + &quot;:&quot; + prefixes[i]</span>
<span class="nc" id="L177">            : keys[i].trim();</span>
<span class="nc" id="L178">        String prefix = prefixes[i];</span>
<span class="nc bnc" id="L179" title="All 4 branches missed.">        if (prefix == null || prefix.isEmpty()) {</span>
<span class="nc" id="L180">          throw new IOException(&quot;no (valid) prefix in mtas document&quot;);</span>
        }
<span class="nc" id="L182">        String type = types[i];</span>
<span class="nc" id="L183">        String regexp = regexps[i];</span>
<span class="nc" id="L184">        String[] list = null;</span>
<span class="nc" id="L185">        Boolean listRegexp = listRegexps[i];</span>
<span class="nc" id="L186">        Boolean listExpand = listExpands[i];</span>
<span class="nc" id="L187">        int listExpandNumber = listExpandNumbers[i];</span>
<span class="nc bnc" id="L188" title="All 2 branches missed.">        if (lists[i] != null) {</span>
<span class="nc" id="L189">          ArrayList&lt;String&gt; tmpList = new ArrayList&lt;&gt;();</span>
<span class="nc" id="L190">          String[] subList = lists[i].split(&quot;(?&lt;!\\\\),&quot;);</span>
<span class="nc bnc" id="L191" title="All 2 branches missed.">          for (int j = 0; j &lt; subList.length; j++) {</span>
<span class="nc" id="L192">            tmpList.add(subList[j].replace(&quot;\\,&quot;, &quot;,&quot;).replace(&quot;\\\\&quot;, &quot;\\&quot;));</span>
          }
<span class="nc" id="L194">          list = tmpList.toArray(new String[tmpList.size()]);</span>
        }
<span class="nc bnc" id="L196" title="All 2 branches missed.">        int listNumber = Math.max(0,</span>
<span class="nc bnc" id="L197" title="All 2 branches missed.">            (listNumbers[i] == null) || (listNumbers[i].isEmpty()) ? 0</span>
<span class="nc" id="L198">                : Integer.parseInt(listNumbers[i]));</span>
<span class="nc" id="L199">        String ignoreRegexp = ignoreRegexps[i];</span>
<span class="nc" id="L200">        String[] ignoreList = null;</span>
<span class="nc" id="L201">        Boolean ignoreListRegexp = ignoreListRegexps[i];</span>
<span class="nc bnc" id="L202" title="All 2 branches missed.">        if (ignoreLists[i] != null) {</span>
<span class="nc" id="L203">          ArrayList&lt;String&gt; tmpList = new ArrayList&lt;&gt;();</span>
<span class="nc" id="L204">          String[] subList = ignoreLists[i].split(&quot;(?&lt;!\\\\),&quot;);</span>
<span class="nc bnc" id="L205" title="All 2 branches missed.">          for (int j = 0; j &lt; subList.length; j++) {</span>
<span class="nc" id="L206">            tmpList.add(subList[j].replace(&quot;\\,&quot;, &quot;,&quot;).replace(&quot;\\\\&quot;, &quot;\\&quot;));</span>
          }
<span class="nc" id="L208">          ignoreList = tmpList.toArray(new String[tmpList.size()]);</span>
        }
<span class="nc" id="L210">        mtasFields.list.get(fields[i]).documentList.add(new ComponentDocument(</span>
            key, prefix, type, regexp, list, listNumber, listRegexp, listExpand,
            listExpandNumber, ignoreRegexp, ignoreList, ignoreListRegexp));
      }
    }
<span class="nc" id="L215">  }</span>

  /*
   * (non-Javadoc)
   * 
   * @see
   * mtas.solr.handler.component.util.MtasSolrComponent#create(mtas.codec.util.
   * CodecComponent.BasicComponent, java.lang.Boolean)
   */
  public SimpleOrderedMap&lt;Object&gt; create(ComponentDocument document,
      Boolean encode) throws IOException {
<span class="nc" id="L226">    SimpleOrderedMap&lt;Object&gt; mtasDocumentResponse = new SimpleOrderedMap&lt;&gt;();</span>
<span class="nc" id="L227">    mtasDocumentResponse.add(&quot;key&quot;, document.key);</span>
<span class="nc" id="L228">    ArrayList&lt;NamedList&lt;Object&gt;&gt; mtasDocumentItemResponses = new ArrayList&lt;&gt;();</span>
<span class="nc bnc" id="L229" title="All 2 branches missed.">    for (int docId : document.statsData.keySet()) {</span>
<span class="nc" id="L230">      NamedList&lt;Object&gt; mtasDocumentItemResponse = new SimpleOrderedMap&lt;&gt;();</span>
<span class="nc" id="L231">      MtasDataCollector&lt;?, ?&gt; stats = document.statsData.get(docId);</span>
<span class="nc" id="L232">      MtasDataCollector&lt;?, ?&gt; list = null;</span>
<span class="nc bnc" id="L233" title="All 2 branches missed.">      if (document.statsList != null) {</span>
<span class="nc" id="L234">        list = document.statsList.get(docId);</span>
      }
<span class="nc" id="L236">      mtasDocumentItemResponse.add(&quot;stats&quot;,</span>
<span class="nc" id="L237">          new MtasSolrMtasResult(stats, stats.getDataType(),</span>
<span class="nc" id="L238">              stats.getStatsType(), stats.getStatsItems(), null));</span>
<span class="nc" id="L239">      mtasDocumentItemResponse.add(&quot;documentKey&quot;,</span>
<span class="nc" id="L240">          document.uniqueKey.get(docId));</span>
<span class="nc bnc" id="L241" title="All 2 branches missed.">      if (list != null) {</span>
<span class="nc bnc" id="L242" title="All 2 branches missed.">        if (document.listExpand) {</span>
<span class="nc" id="L243">          mtasDocumentItemResponse.add(&quot;list&quot;, new MtasSolrMtasResult(list,</span>
<span class="nc" id="L244">              new String[] { list.getDataType(), list.getDataType() },</span>
<span class="nc" id="L245">              new String[] { list.getStatsType(), list.getStatsType() },</span>
<span class="nc" id="L246">              new SortedSet[] { list.getStatsItems(), list.getStatsItems() },</span>
              new String[] { null, null }, new String[] { null, null },
<span class="nc" id="L248">              new Integer[] { 0, 0 }, new Integer[] { 1, 1 }, null));</span>
        } else {
<span class="nc" id="L250">          mtasDocumentItemResponse.add(&quot;list&quot;,</span>
<span class="nc" id="L251">              new MtasSolrMtasResult(list, list.getDataType(),</span>
<span class="nc" id="L252">                  list.getStatsType(), list.getStatsItems(), null));</span>
        }

      }
      // add
<span class="nc" id="L257">      mtasDocumentItemResponses.add(mtasDocumentItemResponse);</span>
<span class="nc" id="L258">    }</span>
<span class="nc" id="L259">    mtasDocumentResponse.add(&quot;list&quot;, mtasDocumentItemResponses);</span>
<span class="nc" id="L260">    MtasSolrResultUtil.rewrite(mtasDocumentResponse);</span>
<span class="nc" id="L261">    return mtasDocumentResponse;</span>
  }

  /*
   * (non-Javadoc)
   * 
   * @see
   * mtas.solr.handler.component.util.MtasSolrComponent#modifyRequest(org.apache
   * .solr.handler.component.ResponseBuilder,
   * org.apache.solr.handler.component.SearchComponent,
   * org.apache.solr.handler.component.ShardRequest)
   */
  public void modifyRequest(ResponseBuilder rb, SearchComponent who,
      ShardRequest sreq) {
<span class="nc bnc" id="L275" title="All 2 branches missed.">    if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false)</span>
<span class="nc bnc" id="L276" title="All 2 branches missed.">        &amp;&amp; sreq.params.getBool(PARAM_MTAS_DOCUMENT, false)) {</span>
<span class="nc bnc" id="L277" title="All 2 branches missed.">      if ((sreq.purpose &amp; ShardRequest.PURPOSE_GET_FIELDS) != 0) {</span>
        // do nothing
      } else {
<span class="nc" id="L280">        Set&lt;String&gt; keys = MtasSolrResultUtil</span>
<span class="nc" id="L281">            .getIdsFromParameters(rb.req.getParams(), PARAM_MTAS_DOCUMENT);</span>
<span class="nc" id="L282">        sreq.params.remove(PARAM_MTAS_DOCUMENT);</span>
<span class="nc bnc" id="L283" title="All 2 branches missed.">        for (String key : keys) {</span>
<span class="nc" id="L284">          sreq.params.remove(</span>
              PARAM_MTAS_DOCUMENT + &quot;.&quot; + key + &quot;.&quot; + NAME_MTAS_DOCUMENT_FIELD);
<span class="nc" id="L286">          sreq.params.remove(</span>
              PARAM_MTAS_DOCUMENT + &quot;.&quot; + key + &quot;.&quot; + NAME_MTAS_DOCUMENT_KEY);
<span class="nc" id="L288">          sreq.params.remove(PARAM_MTAS_DOCUMENT + &quot;.&quot; + key + &quot;.&quot;</span>
              + NAME_MTAS_DOCUMENT_PREFIX);
<span class="nc" id="L290">        }</span>
      }
    }

<span class="nc" id="L294">  }</span>

  /*
   * (non-Javadoc)
   * 
   * @see
   * mtas.solr.handler.component.util.MtasSolrComponent#finishStage(org.apache.
   * solr.handler.component.ResponseBuilder)
   */
  public void finishStage(ResponseBuilder rb) {
<span class="nc bnc" id="L304" title="All 6 branches missed.">    if (rb.req.getParams().getBool(MtasSolrSearchComponent.PARAM_MTAS, false)</span>
        &amp;&amp; rb.stage &gt;= ResponseBuilder.STAGE_EXECUTE_QUERY
        &amp;&amp; rb.stage &lt; ResponseBuilder.STAGE_GET_FIELDS) {
<span class="nc bnc" id="L307" title="All 2 branches missed.">      for (ShardRequest sreq : rb.finished) {</span>
<span class="nc bnc" id="L308" title="All 2 branches missed.">        if (sreq.params.getBool(MtasSolrSearchComponent.PARAM_MTAS, false)</span>
<span class="nc bnc" id="L309" title="All 2 branches missed.">            &amp;&amp; sreq.params.getBool(PARAM_MTAS_DOCUMENT, false)) {</span>
          // nothing to do
        }
<span class="nc" id="L312">      }</span>
    }
<span class="nc" id="L314">  }</span>

  /*
   * (non-Javadoc)
   * 
   * @see
   * mtas.solr.handler.component.util.MtasSolrComponent#distributedProcess(org.
   * apache.solr.handler.component.ResponseBuilder,
   * mtas.codec.util.CodecComponent.ComponentFields)
   */
  public void distributedProcess(ResponseBuilder rb, ComponentFields mtasFields)
      throws IOException {
    // rewrite
<span class="nc" id="L327">    NamedList&lt;Object&gt; mtasResponse = null;</span>
    try {
<span class="nc" id="L329">      mtasResponse = (NamedList&lt;Object&gt;) rb.rsp.getValues().get(&quot;mtas&quot;);</span>
<span class="nc" id="L330">    } catch (ClassCastException e) {</span>
<span class="nc" id="L331">      log.debug(e);</span>
<span class="nc" id="L332">      mtasResponse = null;</span>
<span class="nc" id="L333">    }</span>

<span class="nc bnc" id="L335" title="All 2 branches missed.">    if (mtasResponse != null) {</span>
      ArrayList&lt;Object&gt; mtasResponseDocument;
      try {
<span class="nc" id="L338">        mtasResponseDocument = (ArrayList&lt;Object&gt;) mtasResponse.get(&quot;document&quot;);</span>
<span class="nc bnc" id="L339" title="All 2 branches missed.">        if (mtasResponseDocument != null) {</span>
<span class="nc" id="L340">          MtasSolrResultUtil.rewrite(mtasResponseDocument);</span>
        }
<span class="nc" id="L342">      } catch (ClassCastException e) {</span>
<span class="nc" id="L343">        log.debug(e);</span>
<span class="nc" id="L344">      }</span>
    }

<span class="nc" id="L347">  }</span>

}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.7.9.201702052155</span></div></body></html>