Package org.apache.lucene.queryParser

Examples of org.apache.lucene.queryParser.ParseException


          try {
            aRetArr[d] = new NewsMessageRecord(oTopDoc[d].score, oDoc.get("workarea"),
                         oDoc.get("guid"), oDoc.get("container"), oDoc.get("title"),                      
                         oDoc.get("author"), DateTools.stringToDate(oDoc.get("created")), oDoc.get("abstract"));
          } catch (java.text.ParseException neverthrown) {
            throw new ParseException("NewsMessageSearcher.search() Error parsing date "+oDoc.get("created")+" of document "+oDoc.get("guid"));
          }
        } // next
      } else {
        aRetArr = null;
      }
    } else {
      Hits oHitSet = oSearch.search(oQrx);
      int iHitCount = oHitSet.length();
      if (iHitCount>0) {
        aRetArr = new NewsMessageRecord[iHitCount];
        for (int h=0; h<iHitCount; h++) {
          oDoc = oHitSet.doc(h);
          try {
            aRetArr[h] = new NewsMessageRecord(oHitSet.score(h), oDoc.get("workarea"),
                         oDoc.get("guid"), oDoc.get("container"), oDoc.get("title"),
                         oDoc.get("author"), DateTools.stringToDate(oDoc.get("created")), oDoc.get("abstract"));
          } catch (java.text.ParseException neverthrown) {
            throw new ParseException("NewsMessageSearcher.search() Error parsing date "+oDoc.get("created")+" of document "+oDoc.get("guid"));
          }
        } // next
      } else {
        aRetArr = null;
      }
View Full Code Here


      return searchResult;
    } catch (ServiceNotAvailableException naex) {
      // pass exception
      throw new ServiceNotAvailableException(naex.getMessage());
    } catch (ParseException pex) {
      throw new ParseException("can not parse query=" + queryString);
    } catch (QueryException qex) {
      throw new QueryException(qex.getMessage());
    } catch (Exception ex) {
      log.warn("Exception in search", ex);
      throw new ServiceNotAvailableException(ex.getMessage());
View Full Code Here

          if(isDebug){
            Tracing.logDebug("ENDqueryString=" + queryString,ClusteredSearchRequester.class);
          }
          return searchResult;             
        } else if (responseStatus.equalsIgnoreCase(JMS_RESPONSE_STATUS_PARSE_EXCEPTION)) {
          throw new ParseException("can not parse query=" + queryString);
        } else if (responseStatus.equalsIgnoreCase(JMS_RESPONSE_STATUS_QUERY_EXCEPTION)) {
          throw new QueryException("invalid query=" + queryString);
        } else if (responseStatus.equalsIgnoreCase(JMS_RESPONSE_STATUS_SERVICE_NOT_AVAILABLE_EXCEPTION)) {
          throw new ServiceNotAvailableException("Remote search service not available" + queryString);
        } else {
View Full Code Here

      QueryNode queryTree = this.syntaxParser.parse(query, getField());
      queryTree = this.processorPipeline.process(queryTree);
      return (Query) this.builder.build(queryTree);

    } catch (QueryNodeException e) {
      throw new ParseException("parse exception");
    }

  }
View Full Code Here

    }

    @Override
    protected Query getFuzzyQuery(String field, String termStr,
        float minSimilarity) throws ParseException {
      throw new ParseException("Fuzzy queries not allowed");
    }
View Full Code Here

    }

    @Override
    protected Query getWildcardQuery(String field, String termStr)
        throws ParseException {
      throw new ParseException("Wildcard queries not allowed");
    }
View Full Code Here

          new SelectInListQuery.TransLong());

        return query;

    } catch (Exception e) {
        throw new ParseException(e.toString());
    }
      }
  };
    }
View Full Code Here

        lst.add(valsource);
      }
    }

    if (parseToEnd && sp.pos < sp.end) {
      throw new ParseException("Unexpected text after function: " + sp.val.substring(sp.pos, sp.end));
    }

    if (lst != null) {
      vs = new VectorValueSource(lst);
    }
View Full Code Here

   *
   * @throws ParseException
   */
  public String parseId() throws ParseException {
    String value = parseArg();
    if (argWasQuoted) throw new ParseException("Expected identifier instead of quoted string:" + value);
    return value;
  }
View Full Code Here

   * @return Float
   * @throws ParseException
   */
  public Float parseFloat() throws ParseException {
    String str = parseArg();
    if (argWasQuoted()) throw new ParseException("Expected float instead of quoted string:" + str);
    float value = Float.parseFloat(str);
    return value;
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.queryParser.ParseException

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.