@Test public void test31() throws ParseException, java.text.ParseException { Query q = parseSq("a.id_date:2013-09-13"); Date date = new SimpleDateFormat("yyyy-MM-dd").parse("2013-09-13"); long time = date.getTime(); long converted = TimeUnit.SECONDS.convert(time, TimeUnit.MILLISECONDS); Query q1 = sq(rq_i("a.id_date", converted, converted)); assertQuery(q1, q); }
public Query parse(final String queryStr) throws ParseException { final Map<String, Query> subQueries = new HashMap<String, Query>(); final StringBuilder builder = new StringBuilder(); match(queryStr, new Group() { int _subQueryIndex = 0; @Override public void match(int start, int end) throws ParseException { if (_lastStart != start) { builder.append(queryStr.substring(_lastEnd, start)); } String realQuery = queryStr.substring(start, end); LOG.debug("Realquery [{0}]", realQuery); String superQueryStr = getMatchText(realQuery); LOG.debug("Parseable sub query [{0}]", superQueryStr); String key = _prefixToSub + _subQueryIndex; QueryParser newParser = getNewParser(); Query query = newParser.parse(superQueryStr); if (!isSameGroupName(query)) { throw new ParseException("Super query [" + superQueryStr + "] cannot reference more than one column family."); } if (_superSearch) { query = newSuperQuery(query); } else { query = wrapFilter(query); } subQueries.put(key, query); builder.append(_prefixToSub).append(':').append(_subQueryIndex); _subQueryIndex++; _lastStart = start; _lastEnd = end; } private String getMatchText(String match) { return match.substring(1, match.length() - 1); } }); if (_lastEnd < queryStr.length()) { builder.append(queryStr.substring(_lastEnd)); } Query query = super.parse(builder.toString()); return fixNegatives(reprocess(replaceRealQueries(query, subQueries))); }
SuperParser extends BlurQueryParser { public Query parse(final String queryStr) throws ParseException { final Map<String, Query> subQueries = new HashMap<String, Query>(); final StringBuilder builder = new StringBuilder(); match(queryStr, new Group() { int _subQueryIndex = 0; @Override public void match(int start, int end) throws ParseException { if (_lastStart != start) { builder.append(queryStr.substring(_lastEnd, start)); } String realQuery = queryStr.substring(start, end); LOG.debug("Realquery [{0}]", realQuery); String superQueryStr = getMatchText(realQuery); LOG.debug("Parseable sub query [{0}]", superQueryStr); String key = _prefixToSub + _subQueryIndex; QueryParser newParser = getNewParser(); Query query = newParser.parse(superQueryStr); if (!isSameGroupName(query)) { throw new ParseException("Super query [" + superQueryStr + "] cannot reference more than one column family."); } if (_superSearch) { query = newSuperQuery(query); } else { query = wrapFilter(query); } subQueries.put(key, query); builder.append(_prefixToSub).append(':').append(_subQueryIndex); _subQueryIndex++; _lastStart = start; _lastEnd = end; } private String getMatchText(String match) { return match.substring(1, match.length() - 1); } }); if (_lastEnd < queryStr.length()) { builder.append(queryStr.substring(_lastEnd)); } Query query = super.parse(builder.toString()); return fixNegatives(reprocess(replaceRealQueries(query, subQueries))); } }
SuperParser extends BlurQueryParser { public Query parse(final String queryStr) throws ParseException { final Map<String, Query> subQueries = new HashMap<String, Query>(); final StringBuilder builder = new StringBuilder(); match(queryStr, new Group() { int _subQueryIndex = 0; @Override public void match(int start, int end) throws ParseException { if (_lastStart != start) { builder.append(queryStr.substring(_lastEnd, start)); } String realQuery = queryStr.substring(start, end); LOG.debug("Realquery [{0}]", realQuery); String superQueryStr = getMatchText(realQuery); LOG.debug("Parseable sub query [{0}]", superQueryStr); String key = _prefixToSub + _subQueryIndex; QueryParser newParser = getNewParser(); Query query = newParser.parse(superQueryStr); if (!isSameGroupName(query)) { throw new ParseException("Super query [" + superQueryStr + "] cannot reference more than one column family."); } if (_superSearch) { query = newSuperQuery(query); } else { query = wrapFilter(query); } subQueries.put(key, query); builder.append(_prefixToSub).append(':').append(_subQueryIndex); _subQueryIndex++; _lastStart = start; _lastEnd = end; } private String getMatchText(String match) { return match.substring(1, match.length() - 1); } }); if (_lastEnd < queryStr.length()) { builder.append(queryStr.substring(_lastEnd)); } Query query = super.parse(builder.toString()); return fixNegatives(reprocess(replaceRealQueries(query, subQueries))); } SuperParser(Version matchVersion, FieldManager fieldManager, boolean superSearch, Filter queryFilter,
      ScoreType scoreType, Term defaultPrimeDocTerm); }
SuperParser extends BlurQueryParser { public Query parse(final String queryStr) throws ParseException { final Map<String, Query> subQueries = new HashMap<String, Query>(); final StringBuilder builder = new StringBuilder(); match(queryStr, new Group() { int _subQueryIndex = 0; @Override public void match(int start, int end) throws ParseException { if (_lastStart != start) { builder.append(queryStr.substring(_lastEnd, start)); } String realQuery = queryStr.substring(start, end); LOG.debug("Realquery [{0}]", realQuery); String superQueryStr = getMatchText(realQuery); LOG.debug("Parseable sub query [{0}]", superQueryStr); String key = _prefixToSub + _subQueryIndex; QueryParser newParser = getNewParser(); Query query = newParser.parse(superQueryStr); if (!isSameGroupName(query)) { throw new ParseException("Super query [" + superQueryStr + "] cannot reference more than one column family."); } if (_superSearch) { query = newSuperQuery(query); } else { query = wrapFilter(query); } subQueries.put(key, query); builder.append(_prefixToSub).append(':').append(_subQueryIndex); _subQueryIndex++; _lastStart = start; _lastEnd = end; } private String getMatchText(String match) { return match.substring(1, match.length() - 1); } }); if (_lastEnd < queryStr.length()) { builder.append(queryStr.substring(_lastEnd)); } Query query = super.parse(builder.toString()); return fixNegatives(reprocess(replaceRealQueries(query, subQueries))); } SuperParser(Version matchVersion, FieldManager fieldManager, boolean superSearch, Filter queryFilter,
      ScoreType scoreType, Term defaultPrimeDocTerm); Query parse(final String queryStr); }
SuperParser extends BlurQueryParser { public Query parse(final String queryStr) throws ParseException { final Map<String, Query> subQueries = new HashMap<String, Query>(); final StringBuilder builder = new StringBuilder(); match(queryStr, new Group() { int _subQueryIndex = 0; @Override public void match(int start, int end) throws ParseException { if (_lastStart != start) { builder.append(queryStr.substring(_lastEnd, start)); } String realQuery = queryStr.substring(start, end); LOG.debug("Realquery [{0}]", realQuery); String superQueryStr = getMatchText(realQuery); LOG.debug("Parseable sub query [{0}]", superQueryStr); String key = _prefixToSub + _subQueryIndex; QueryParser newParser = getNewParser(); Query query = newParser.parse(superQueryStr); if (!isSameGroupName(query)) { throw new ParseException("Super query [" + superQueryStr + "] cannot reference more than one column family."); } if (_superSearch) { query = newSuperQuery(query); } else { query = wrapFilter(query); } subQueries.put(key, query); builder.append(_prefixToSub).append(':').append(_subQueryIndex); _subQueryIndex++; _lastStart = start; _lastEnd = end; } private String getMatchText(String match) { return match.substring(1, match.length() - 1); } }); if (_lastEnd < queryStr.length()) { builder.append(queryStr.substring(_lastEnd)); } Query query = super.parse(builder.toString()); return fixNegatives(reprocess(replaceRealQueries(query, subQueries))); } SuperParser(Version matchVersion, FieldManager fieldManager, boolean superSearch, Filter queryFilter,
      ScoreType scoreType, Term defaultPrimeDocTerm); Query parse(final String queryStr);  }