Example usage for org.apache.solr.common.params CommonParams EXPLAIN_STRUCT

List of usage examples for org.apache.solr.common.params CommonParams EXPLAIN_STRUCT

Introduction

In this page you can find the example usage for org.apache.solr.common.params CommonParams EXPLAIN_STRUCT.

Prototype

String EXPLAIN_STRUCT

To view the source code for org.apache.solr.common.params CommonParams EXPLAIN_STRUCT.

Click Source Link

Document

boolean indicating whether score explanations should structured (true), or plain text (false)

Usage

From source file:edu.toronto.cs.phenotips.solr.OmimScriptService.java

License:Open Source License

/**
 * Prepare the map of parameters that can be passed to a Solr query, in order to get a list of diseases matching the
 * selected positive and negative phenotypes.
 *
 * @param phenotypes the list of already selected phenotypes
 * @param nphenotypes phenotypes that are not observed in the patient
 * @return the computed Solr query parameters
 *//*from w  w  w .  j  a  v a 2 s  . c  o  m*/
private MapSolrParams prepareParams(Collection<String> phenotypes, Collection<String> nphenotypes) {
    Map<String, String> params = new HashMap<String, String>();
    String q = "symptom:" + StringUtils.join(phenotypes, " symptom:");
    if (nphenotypes.size() > 0) {
        q += "  not_symptom:" + StringUtils.join(nphenotypes, " not_symptom:");
    }
    params.put(CommonParams.Q, q.replaceAll("HP:", "HP\\\\:"));
    params.put(CommonParams.ROWS, "100");
    params.put(CommonParams.START, "0");
    params.put(CommonParams.DEBUG_QUERY, Boolean.toString(true));
    params.put(CommonParams.EXPLAIN_STRUCT, Boolean.toString(true));

    return new MapSolrParams(params);
}

From source file:org.phenotips.diagnosis.differentialPhenotypes.PhenotypeSuggestService.java

License:Open Source License

/**
 * Prepare the map of parameters that can be passed to a Solr query, in order to get a list of diseases matching the
 * selected positive and negative phenotypes.
 *
 * @param phenotypes the list of already selected phenotypes
 * @param nphenotypes phenotypes that are not observed in the patient
 * @return the computed Solr query parameters
 *///ww w  .  ja va2  s . c o m
private SolrQuery prepareParams(Collection<String> phenotypes, Collection<String> nphenotypes) {
    SolrQuery result = new SolrQuery();
    String q = "symptom:" + StringUtils.join(phenotypes, " symptom:");
    if (!nphenotypes.isEmpty()) {
        q += "  not_symptom:" + StringUtils.join(nphenotypes, " not_symptom:");
    }
    q += " -nameSort:\\** -nameSort:\\+* -nameSort:\\^*";
    result.set(CommonParams.Q, q.replaceAll("HP:", "HP\\\\:"));
    result.set(CommonParams.ROWS, "100");
    result.set(CommonParams.START, "0");
    result.set(CommonParams.DEBUG_QUERY, Boolean.toString(true));
    result.set(CommonParams.EXPLAIN_STRUCT, Boolean.toString(true));

    return result;
}

From source file:org.phenotips.solr.OmimScriptService.java

License:Open Source License

/**
 * Prepare the map of parameters that can be passed to a Solr query, in order to get a list of diseases matching the
 * selected positive and negative phenotypes.
 *
 * @param phenotypes the list of already selected phenotypes
 * @param nphenotypes phenotypes that are not observed in the patient
 * @return the computed Solr query parameters
 *//*  w ww  .  j a v  a  2 s.  com*/
private MapSolrParams prepareParams(Collection<String> phenotypes, Collection<String> nphenotypes) {
    Map<String, String> params = new HashMap<String, String>();
    String q = "symptom:" + StringUtils.join(phenotypes, " symptom:");
    if (nphenotypes.size() > 0) {
        q += "  not_symptom:" + StringUtils.join(nphenotypes, " not_symptom:");
    }
    q += " -nameSort:\\** -nameSort:\\+* -nameSort:\\^*";
    params.put(CommonParams.Q, q.replaceAll("HP:", "HP\\\\:"));
    params.put(CommonParams.ROWS, "100");
    params.put(CommonParams.START, "0");
    params.put(CommonParams.DEBUG_QUERY, Boolean.toString(true));
    params.put(CommonParams.EXPLAIN_STRUCT, Boolean.toString(true));

    return new MapSolrParams(params);
}