MtasJoinQParser.java.html
3.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?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>MtasJoinQParser.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> > <a href="index.source.html" class="el_package">mtas.solr.search</a> > <span class="el_source">MtasJoinQParser.java</span></div><h1>MtasJoinQParser.java</h1><pre class="source lang-java linenums">package mtas.solr.search;
import org.apache.lucene.search.Query;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.search.QParser;
import org.apache.solr.search.SyntaxError;
/**
* The Class MtasJoinQParser.
*/
public class MtasJoinQParser extends QParser {
/** The Constant MTAS_JOIN_QPARSER_URL. */
public static final String MTAS_JOIN_QPARSER_URL = "url";
/** The Constant MTAS_JOIN_QPARSER_REQUEST. */
public static final String MTAS_JOIN_QPARSER_REQUEST = "request";
/** The url. */
<span class="nc" id="L21"> String url = null;</span>
/** The request. */
<span class="nc" id="L24"> String request = null;</span>
/**
* Instantiates a new mtas join Q parser.
*
* @param qstr the qstr
* @param localParams the local params
* @param params the params
* @param req the req
*/
public MtasJoinQParser(String qstr, SolrParams localParams, SolrParams params,
SolrQueryRequest req) {
<span class="nc" id="L36"> super(qstr, localParams, params, req);</span>
// SearchComponent sc = req.getCore().getSearchComponent("mtas");
// if ((sc != null) && (sc instanceof MtasSolrSearchComponent)) {
// msc = (MtasSolrSearchComponent) sc;
// }
<span class="nc bnc" id="L42" title="All 2 branches missed."> if ((localParams.getParams(MTAS_JOIN_QPARSER_URL) != null)</span>
<span class="nc bnc" id="L43" title="All 2 branches missed."> && (localParams.getParams(MTAS_JOIN_QPARSER_URL).length == 1)) {</span>
<span class="nc" id="L44"> url = localParams.getParams(MTAS_JOIN_QPARSER_URL)[0];</span>
}
<span class="nc bnc" id="L46" title="All 2 branches missed."> if ((localParams.getParams(MTAS_JOIN_QPARSER_REQUEST) != null)</span>
<span class="nc bnc" id="L47" title="All 2 branches missed."> && (localParams.getParams(MTAS_JOIN_QPARSER_REQUEST).length == 1)) {</span>
<span class="nc" id="L48"> request = localParams.getParams(MTAS_JOIN_QPARSER_REQUEST)[0];</span>
}
<span class="nc" id="L50"> }</span>
/*
* (non-Javadoc)
*
* @see org.apache.solr.search.QParser#parse()
*/
@Override
public Query parse() throws SyntaxError {
<span class="nc bnc" id="L59" title="All 2 branches missed."> if (url == null) {</span>
<span class="nc" id="L60"> throw new SyntaxError("no " + MTAS_JOIN_QPARSER_URL);</span>
<span class="nc bnc" id="L61" title="All 2 branches missed."> } else if (request == null) {</span>
<span class="nc" id="L62"> throw new SyntaxError("no " + MTAS_JOIN_QPARSER_REQUEST);</span>
} else {
<span class="nc" id="L64"> return null;</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>