Package org.apache.solr.common

Examples of org.apache.solr.common.SolrException


    String[] p2;
    try {
      p1 = DistanceUtils.parsePoint(null, part1, dimension);
      p2 = DistanceUtils.parsePoint(null, part2, dimension);
    } catch (InvalidGeoException e) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
    }
    BooleanQuery result = new BooleanQuery(true);
    for (int i = 0; i < dimension; i++) {
      SchemaField subSF = subField(field, i);
      // points must currently be ordered... should we support specifying any two opposite corner points?
View Full Code Here


   
    String[] p1 = new String[0];
    try {
      p1 = DistanceUtils.parsePoint(null, externalVal, dimension);
    } catch (InvalidGeoException e) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
    }
    BooleanQuery bq = new BooleanQuery(true);
    for (int i = 0; i < dimension; i++) {
      SchemaField sf = subField(field, i);
      Query tq = sf.getType().getFieldQuery(parser, sf, p1[i]);
View Full Code Here

  public Query createSpatialQuery(QParser parser, SpatialOptions options) {
    double[] point = null;
    try {
      point = DistanceUtils.parseLatitudeLongitude(options.pointStr);
    } catch (InvalidGeoException e) {
      throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, e);
    }

    // lat & lon in degrees
    double latCenter = point[LAT];
    double lonCenter = point[LONG];
View Full Code Here

    writer.writeStr(name, f.stringValue(), false);
  }

  @Override
  public SortField getSortField(SchemaField field, boolean top) {
    throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Sorting not supported on SpatialTileField " + field.getName());
  }
View Full Code Here

    dictFile = args.get("dictionary");
    if (args.containsKey("encoding"))
      encoding = args.get("encoding");
    hypFile = args.get("hyphenator");
    if (null == hypFile) {
      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
          "Missing required parameter: hyphenator");
    }

    minWordSize = getInt("minWordSize", CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE);
    minSubwordSize = getInt("minSubwordSize", CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE);
View Full Code Here

  public void init(Map<String, String> args) {
    super.init(args);
    maxShingleSize = getInt("maxShingleSize",
                            ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE);
    if (maxShingleSize < 2) {
      throw new SolrException(ErrorCode.SERVER_ERROR,
                              "Invalid maxShingleSize (" + maxShingleSize
                              + ") - must be at least 2");
    }
    minShingleSize = getInt("minShingleSize",
                            ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE);
    if (minShingleSize < 2) {
      throw new SolrException(ErrorCode.SERVER_ERROR,
                              "Invalid minShingleSize (" + minShingleSize
                              + ") - must be at least 2");
    }
    if (minShingleSize > maxShingleSize) {
      throw new SolrException(ErrorCode.SERVER_ERROR,
                              "Invalid minShingleSize (" + minShingleSize
                              + ") - must be no greater than maxShingleSize ("
                              + maxShingleSize + ")");
    }
    outputUnigrams = getBoolean("outputUnigrams", true);
View Full Code Here

    String affixFile = args.get(PARAM_AFFIX);
    String pic = args.get(PARAM_IGNORE_CASE);
    if(pic != null) {
      if(pic.equalsIgnoreCase(TRUE)) ignoreCase = true;
      else if(pic.equalsIgnoreCase(FALSE)) ignoreCase = false;
      else throw new SolrException(ErrorCode.UNKNOWN, "Unknown value for "+PARAM_IGNORE_CASE+": "+pic+". Must be true or false");
    }

    try {
      List<InputStream> dictionaries = new ArrayList<InputStream>();
      for (String file : dictionaryFiles) {
View Full Code Here

                throw new Exception("null != facetFs");
              }
          }catch(Throwable e)
          {
            LOG.error("getFacetCounts",e);
            throw new SolrException(ErrorCode.SERVER_ERROR,e);
          }
         
          long t3=System.currentTimeMillis();
         
          LOG.info("####task####"+(t3-t2)+","+(t2-t1));
View Full Code Here

        for (SearchGroup<String> mergedTopGroup : mergedTopGroups) {
          rb.searchGroupToShard.get(groupField).put(mergedTopGroup, tempSearchGroupToShard.get(groupField).get(mergedTopGroup));
        }
      }
    } catch (IOException e) {
      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
    }
  }
View Full Code Here

        }
      }

      rb.resultIds = resultIds;
    } catch (IOException e) {
      throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.solr.common.SolrException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.