/** * Uses {@link SolrPluginUtils#parseFieldBoosts(String)} with the 'qf' * parameter. Falls back to the 'df' parameter or * {@link org.apache.solr.schema.IndexSchema#getDefaultSearchFieldName()}. */ public static Map<String, Float> parseQueryFields(final IndexSchema indexSchema, final SolrParams solrParams) throws ParseException { final Map<String, Float> queryFields = SolrPluginUtils.parseFieldBoosts(solrParams.getParams(SirenParams.QF)); if (queryFields.isEmpty()) { final String df = QueryParsing.getDefaultField(indexSchema, solrParams.get(CommonParams.DF)); if (df == null) { throw new ParseException("Neither "+SirenParams.QF+", "+CommonParams.DF +", nor the default search field are present."); } queryFields.put(df, 1.0f); } checkFieldTypes(indexSchema, queryFields); return queryFields; }
/** * Uses {@link SolrPluginUtils#parseFieldBoosts(String)} with the 'qf' * parameter. Falls back to the 'df' parameter or * {@link org.apache.solr.schema.IndexSchema#getDefaultSearchFieldName()}. */ public static Map<String, Float> parseQueryFields(final IndexSchema indexSchema, final SolrParams solrParams) throws SyntaxError { final Map<String, Float> queryFields = SolrPluginUtils.parseFieldBoosts(solrParams.getParams(SirenParams.QF)); if (queryFields.isEmpty()) { final String df = QueryParsing.getDefaultField(indexSchema, solrParams.get(CommonParams.DF)); if (df == null) { throw new SyntaxError("Neither "+SirenParams.QF+", "+CommonParams.DF +", nor the default search field are present."); } queryFields.put(df, 1.0f); } checkFieldTypes(indexSchema, queryFields); return queryFields; }