Package org.apache.solr.schema

Examples of org.apache.solr.schema.FieldType.toInternal()


          String field = StringHelper.intern(fields[j]);
          FieldType ft = raw ? null : rb.req.getSchema().getFieldTypeNoEx(field);
          if (ft==null) ft = new StrField();

          // If no lower bound was specified, use the prefix
          String lower = lowerStr==null ? prefix : (raw ? lowerStr : ft.toInternal(lowerStr));
          if (lower == null) lower="";
          String upper = upperStr==null ? null : (raw ? upperStr : ft.toInternal(upperStr));

          Term lowerTerm = new Term(field, lower);
          Term upperTerm = upper==null ? null : new Term(field, upper);
View Full Code Here


          if (ft==null) ft = new StrField();

          // If no lower bound was specified, use the prefix
          String lower = lowerStr==null ? prefix : (raw ? lowerStr : ft.toInternal(lowerStr));
          if (lower == null) lower="";
          String upper = upperStr==null ? null : (raw ? upperStr : ft.toInternal(upperStr));

          Term lowerTerm = new Term(field, lower);
          Term upperTerm = upper==null ? null : new Term(field, upper);
         
          TermEnum termEnum = rb.req.getSearcher().getReader().terms(lowerTerm); //this will be positioned ready to go
View Full Code Here

      public Query parse() throws ParseException {
        String field = localParams.get(QueryParsing.F);
        String queryText = localParams.get(QueryParsing.V);
        FieldType ft = req.getSchema().getFieldType(field);
        if (!(ft instanceof TextField)) {
          String internal = ft.toInternal(queryText);
          return new TermQuery(new Term(field, internal));
        }

        int phraseSlop = 0;
        Analyzer analyzer = req.getSchema().getQueryAnalyzer();
View Full Code Here

        }
        */
        String key = line.substring(0, delimIndex);
        String val = line.substring(delimIndex+1, endIndex);

        String internalKey = idType.toInternal(key);
        float fval;
        try {
          fval=Float.parseFloat(val);
        } catch (Exception e) {
          if (++otherErrors<=10) {
View Full Code Here

  protected Query getRangeQuery(String field, String part1, String part2, boolean inclusive) throws ParseException {
    FieldType ft = schema.getFieldType(field);
    return new ConstantScoreRangeQuery(
      field,
      "*".equals(part1) ? null : ft.toInternal(part1),
      "*".equals(part2) ? null : ft.toInternal(part2),
      inclusive, inclusive);
  }

  protected Query getPrefixQuery(String field, String termStr) throws ParseException {
View Full Code Here

  protected Query getRangeQuery(String field, String part1, String part2, boolean inclusive) throws ParseException {
    FieldType ft = schema.getFieldType(field);
    return new ConstantScoreRangeQuery(
      field,
      "*".equals(part1) ? null : ft.toInternal(part1),
      "*".equals(part2) ? null : ft.toInternal(part2),
      inclusive, inclusive);
  }

  protected Query getPrefixQuery(String field, String termStr) throws ParseException {
    if (getLowercaseExpandedTerms()) {
View Full Code Here

    int min=mincount-1// the smallest value in the top 'N' values   
    int off=offset;
    int lim=limit>=0 ? limit : Integer.MAX_VALUE;

    String startTerm = prefix==null ? "" : ft.toInternal(prefix);
    TermEnum te = r.terms(new Term(field,startTerm));
    TermDocs td = r.termDocs();

    if (docs.size() >= mincount) {
    do {
View Full Code Here

    int min=mincount-1// the smallest value in the top 'N' values   
    int off=offset;
    int lim=limit>=0 ? limit : Integer.MAX_VALUE;

    String startTerm = prefix==null ? "" : ft.toInternal(prefix);
    TermEnum te = r.terms(new Term(field,startTerm));
    TermDocs td = r.termDocs();
    do {
      Term t = te.term();
View Full Code Here

  protected Query getRangeQuery(String field, String part1, String part2, boolean inclusive) throws ParseException {
    FieldType ft = schema.getFieldType(field);
    return new ConstantScoreRangeQuery(
      field,
      "*".equals(part1) ? null : ft.toInternal(part1),
      "*".equals(part2) ? null : ft.toInternal(part2),
      inclusive, inclusive);
  }

  protected Query getPrefixQuery(String field, String termStr) throws ParseException {
View Full Code Here

  protected Query getRangeQuery(String field, String part1, String part2, boolean inclusive) throws ParseException {
    FieldType ft = schema.getFieldType(field);
    return new ConstantScoreRangeQuery(
      field,
      "*".equals(part1) ? null : ft.toInternal(part1),
      "*".equals(part2) ? null : ft.toInternal(part2),
      inclusive, inclusive);
  }

  protected Query getPrefixQuery(String field, String termStr) throws ParseException {
    if (getLowercaseExpandedTerms()) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.