本文整理汇总了Java中org.apache.solr.util.SolrPluginUtils.doStandardDebug方法的典型用法代码示例。如果您正苦于以下问题:Java SolrPluginUtils.doStandardDebug方法的具体用法?Java SolrPluginUtils.doStandardDebug怎么用?Java SolrPluginUtils.doStandardDebug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.solr.util.SolrPluginUtils
的用法示例。
在下文中一共展示了SolrPluginUtils.doStandardDebug方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void process(ResponseBuilder rb) throws IOException
{
if( rb.isDebug() ) {
NamedList stdinfo = SolrPluginUtils.doStandardDebug( rb.req,
rb.getQueryString(), rb.getQuery(), rb.getResults().docList, rb.isDebugQuery(), rb.isDebugResults());
NamedList info = rb.getDebugInfo();
if( info == null ) {
rb.setDebugInfo( stdinfo );
info = stdinfo;
}
else {
info.addAll( stdinfo );
}
if (rb.isDebugQuery() && rb.getQparser() != null) {
rb.getQparser().addDebugInfo(rb.getDebugInfo());
}
if (null != rb.getDebugInfo() ) {
if (rb.isDebugQuery() && null != rb.getFilters() ) {
info.add("filter_queries",rb.req.getParams().getParams(FQ));
List<String> fqs = new ArrayList<String>(rb.getFilters().size());
for (Query fq : rb.getFilters()) {
fqs.add(QueryParsing.toString(fq, rb.req.getSchema()));
}
info.add("parsed_filter_queries",fqs);
}
// Add this directly here?
rb.rsp.add("debug", rb.getDebugInfo() );
}
}
}
示例2: addDebugInfo
import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
private void addDebugInfo(SolrQueryRequest req, SolrQueryResponse rsp, String q, List<Query> rfFqFilters, RFResult RFResult) {
DocListAndSet rfDocs = RFResult.getResults();
boolean dbg = req.getParams().getBool(CommonParams.DEBUG_QUERY, false);
boolean dbgQuery = false, dbgResults = false;
if (dbg == false){//if it's true, we are doing everything anyway.
String[] dbgParams = req.getParams().getParams(CommonParams.DEBUG);
if (dbgParams != null) {
for (int i = 0; i < dbgParams.length; i++) {
if (dbgParams[i].equals(CommonParams.QUERY)){
dbgQuery = true;
} else if (dbgParams[i].equals(CommonParams.RESULTS)){
dbgResults = true;
}
}
}
} else {
dbgQuery = true;
dbgResults = true;
}
// Copied from StandardRequestHandler... perhaps it should be added to doStandardDebug?
if (dbg == true) {
try {
NamedList<String> it = getRFTermsForDebug(RFResult.getRFTerms());
NamedList<Object> dbgInfo = new NamedList<Object>();
NamedList<Object> stdDbg = SolrPluginUtils.doStandardDebug(req, q, RFResult.getQuery(), rfDocs.docList, dbgQuery, dbgResults);
if (null != dbgInfo) {
rsp.add("debug", dbgInfo);
dbgInfo.add( "ufTerms", it );
dbgInfo.addAll(stdDbg);
if (null != rfFqFilters) {
dbgInfo.add("filter_queries",req.getParams().getParams(CommonParams.FQ));
List<String> fqs = new ArrayList<String>(rfFqFilters.size());
for (Query fq : rfFqFilters) {
fqs.add(QueryParsing.toString(fq, req.getSchema()));
}
dbgInfo.add("uf_filter_queries",fqs);
}
}
} catch (Exception e) {
SolrException.log(log, "Exception during debug", e);
rsp.add("exception_during_debug", SolrException.toStr(e));
}
}
}
示例3: addDebugInfo
import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
private void addDebugInfo(SolrQueryRequest req, SolrQueryResponse rsp, String q, List<Query> rfFqFilters, RFHelper rfHelper, RFResult RFResult, DocListAndSet rfDocs) {
boolean dbg = req.getParams().getBool(CommonParams.DEBUG_QUERY, false);
boolean dbgQuery = false, dbgResults = false;
if (dbg == false){//if it's true, we are doing everything anyway.
String[] dbgParams = req.getParams().getParams(CommonParams.DEBUG);
if (dbgParams != null) {
for (int i = 0; i < dbgParams.length; i++) {
if (dbgParams[i].equals(CommonParams.QUERY)){
dbgQuery = true;
} else if (dbgParams[i].equals(CommonParams.RESULTS)){
dbgResults = true;
}
}
}
} else {
dbgQuery = true;
dbgResults = true;
}
// Copied from StandardRequestHandler... perhaps it should be added to doStandardDebug?
if (dbg == true && RFResult != null) {
try {
NamedList<String> it = getRFTermsForDebug(RFResult);
NamedList<Object> dbgInfo = new NamedList<Object>();
NamedList<Object> stdDbg = SolrPluginUtils.doStandardDebug(req, q, RFResult.getQuery(), rfDocs.docList, dbgQuery, dbgResults);
if (null != dbgInfo) {
rsp.add("debug", dbgInfo);
dbgInfo.add( "RFTerms", it );
dbgInfo.addAll(stdDbg);
if (null != rfFqFilters) {
dbgInfo.add("filter_queries",req.getParams().getParams(CommonParams.FQ));
List<String> fqs = new ArrayList<String>(rfFqFilters.size());
for (Query fq : rfFqFilters) {
fqs.add(QueryParsing.toString(fq, req.getSchema()));
}
dbgInfo.add("rf_filter_queries",fqs);
}
}
} catch (Exception e) {
SolrException.log(log, "Exception during debug", e);
rsp.add("exception_during_debug", SolrException.toStr(e));
}
}
}
示例4: process
import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void process(ResponseBuilder rb) throws IOException
{
if( rb.isDebug() ) {
DocList results = null;
//some internal grouping requests won't have results value set
if(rb.getResults() != null) {
results = rb.getResults().docList;
}
NamedList stdinfo = SolrPluginUtils.doStandardDebug( rb.req,
rb.getQueryString(), rb.wrap(rb.getQuery()), results, rb.isDebugQuery(), rb.isDebugResults());
NamedList info = rb.getDebugInfo();
if( info == null ) {
rb.setDebugInfo( stdinfo );
info = stdinfo;
}
else {
info.addAll( stdinfo );
}
if (rb.isDebugQuery() && rb.getQparser() != null) {
rb.getQparser().addDebugInfo(rb.getDebugInfo());
}
if (null != rb.getDebugInfo() ) {
if (rb.isDebugQuery() && null != rb.getFilters() ) {
info.add("filter_queries",rb.req.getParams().getParams(FQ));
List<String> fqs = new ArrayList<>(rb.getFilters().size());
for (Query fq : rb.getFilters()) {
fqs.add(QueryParsing.toString(fq, rb.req.getSchema()));
}
info.add("parsed_filter_queries",fqs);
}
// Add this directly here?
rb.rsp.add("debug", rb.getDebugInfo() );
}
}
}
示例5: addDebugInfo
import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
private void addDebugInfo(SolrQueryRequest req, SolrQueryResponse rsp, String q, List<Query> mltFqFilters, MLTResult mltResult) {
DocListAndSet mltDocs = mltResult.getResults();
boolean dbg = req.getParams().getBool(CommonParams.DEBUG_QUERY, false);
boolean dbgQuery = false, dbgResults = false;
if (dbg == false){//if it's true, we are doing everything anyway.
String[] dbgParams = req.getParams().getParams(CommonParams.DEBUG);
if (dbgParams != null) {
for (int i = 0; i < dbgParams.length; i++) {
if (dbgParams[i].equals(CommonParams.QUERY)){
dbgQuery = true;
} else if (dbgParams[i].equals(CommonParams.RESULTS)){
dbgResults = true;
}
}
}
} else {
dbgQuery = true;
dbgResults = true;
}
// Copied from StandardRequestHandler... perhaps it should be added to doStandardDebug?
if (dbg == true) {
try {
NamedList<String> it = getMltTermsForDebug(mltResult.getMltTerms());
NamedList<Object> dbgInfo = new NamedList<Object>();
NamedList<Object> stdDbg = SolrPluginUtils.doStandardDebug(req, q, mltResult.getQuery(), mltDocs.docList, dbgQuery, dbgResults);
if (null != dbgInfo) {
rsp.add("debug", dbgInfo);
dbgInfo.add( "mltTerms", it );
dbgInfo.addAll(stdDbg);
if (null != mltFqFilters) {
dbgInfo.add("filter_queries",req.getParams().getParams(CommonParams.FQ));
List<String> fqs = new ArrayList<String>(mltFqFilters.size());
for (Query fq : mltFqFilters) {
fqs.add(QueryParsing.toString(fq, req.getSchema()));
}
dbgInfo.add("mlt_filter_queries",fqs);
}
}
} catch (Exception e) {
SolrException.log(log, "Exception during debug", e);
rsp.add("exception_during_debug", SolrException.toStr(e));
}
}
}
示例6: addDebugInfo
import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
private void addDebugInfo(SolrQueryRequest req, SolrQueryResponse rsp, String q, List<Query> mltFqFilters, MLTResult mltResult) {
DocListAndSet mltDocs = mltResult.getResults();
boolean dbg = req.getParams().getBool(CommonParams.DEBUG_QUERY, false);
boolean dbgQuery = false, dbgResults = false;
if (dbg == false){//if it's true, we are doing everything anyway.
String[] dbgParams = req.getParams().getParams(CommonParams.DEBUG);
if (dbgParams != null) {
for (int i = 0; i < dbgParams.length; i++) {
if (dbgParams[i].equals(CommonParams.QUERY)){
dbgQuery = true;
} else if (dbgParams[i].equals(CommonParams.RESULTS)){
dbgResults = true;
}
}
}
} else {
dbgQuery = true;
dbgResults = true;
}
// Copied from StandardRequestHandler... perhaps it should be added to doStandardDebug?
if (dbg == true) {
try {
NamedList<String> it = getMltTermsForDebug(mltResult.getMltTerms());
NamedList<Object> dbgInfo = new NamedList<Object>();
NamedList<Object> stdDbg = SolrPluginUtils.doStandardDebug(req, q, mltResult.getQuery(), mltDocs.docList, dbgQuery, dbgResults);
if (null != dbgInfo) {
rsp.add("debug", dbgInfo);
dbgInfo.add( "mltTerms", it );
dbgInfo.addAll(stdDbg);
if (null != mltFqFilters) {
dbgInfo.add("filter_queries",req.getParams().getParams(CommonParams.FQ));
List<String> fqs = new ArrayList<String>(mltFqFilters.size());
for (Query fq : mltFqFilters) {
fqs.add(QueryParsing.toString(fq, req.getSchema()));
}
dbgInfo.add("mlt_filter_queries",fqs);
}
}
} catch (Exception e) {
SolrException.log(log, "Exception during debug", e);
rsp.add("exception_during_debug", SolrException.toStr(e));
}
}
}
示例7: process
import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void process(ResponseBuilder rb) throws IOException
{
if( rb.isDebug() ) {
DocList results = null;
//some internal grouping requests won't have results value set
if(rb.getResults() != null) {
results = rb.getResults().docList;
}
NamedList stdinfo = SolrPluginUtils.doStandardDebug( rb.req,
rb.getQueryString(), rb.getQuery(), results, rb.isDebugQuery(), rb.isDebugResults());
NamedList info = rb.getDebugInfo();
if( info == null ) {
rb.setDebugInfo( stdinfo );
info = stdinfo;
}
else {
info.addAll( stdinfo );
}
if (rb.isDebugQuery() && rb.getQparser() != null) {
rb.getQparser().addDebugInfo(rb.getDebugInfo());
}
if (null != rb.getDebugInfo() ) {
if (rb.isDebugQuery() && null != rb.getFilters() ) {
info.add("filter_queries",rb.req.getParams().getParams(FQ));
List<String> fqs = new ArrayList<String>(rb.getFilters().size());
for (Query fq : rb.getFilters()) {
fqs.add(QueryParsing.toString(fq, rb.req.getSchema()));
}
info.add("parsed_filter_queries",fqs);
}
// Add this directly here?
rb.rsp.add("debug", rb.getDebugInfo() );
}
}
}