@Override String getRawText(PropertyValue v) { Iterable<String> terms = SPACE_SPLITTER.split(super.getRawText(v)); StringBuffer raw = new StringBuffer(); for (String term : terms) { if (isKeyword(term)) { raw.append(String.format("%s ", term)); } else { raw.append(String.format("-%s ", term)); } } return raw.toString().trim(); }
@Override String getRawText(PropertyValue v) { Iterable<String> terms = SPACE_SPLITTER.split(super.getRawText(v)); StringBuffer raw = new StringBuffer(); for (String term : terms) { if (isKeyword(term)) { raw.append(String.format("%s ", term)); } else { raw.append(String.format("-%s ", term)); } } return raw.toString().trim(); }
@Override String getRawText(PropertyValue v) { Iterable<String> terms = SPACE_SPLITTER.split(super.getRawText(v)); StringBuffer raw = new StringBuffer(); for (String term : terms) { if (isKeyword(term)) { raw.append(String.format("%s ", term)); } else { raw.append(String.format("-%s ", term)); } } return raw.toString().trim(); }
@Override public FullTextExpression getFullTextConstraint(SelectorImpl s) { if (!s.equals(selector)) { return null; } PropertyValue v = fullTextSearchExpression.currentValue(); try { String p = propertyName; if (relativePath != null) { if (p == null) { p = "*"; } p = PathUtils.concat(relativePath, p); } String p2 = normalizePropertyName(p); String rawText = getRawText(v); FullTextExpression e = FullTextParser.parse(p2, rawText); return new FullTextContains(p2, rawText, e); } catch (ParseException e) { throw new IllegalArgumentException("Invalid expression: " + fullTextSearchExpression, e); } }
@Override public FullTextExpression getFullTextConstraint(SelectorImpl s) { if (!s.equals(selector)) { return null; } PropertyValue v = fullTextSearchExpression.currentValue(); try { String p = propertyName; if (relativePath != null) { if (p == null) { p = "*"; } p = PathUtils.concat(relativePath, p); } String p2 = normalizePropertyName(p); String rawText = getRawText(v); FullTextExpression e = FullTextParser.parse(p2, rawText); return new FullTextContains(p2, rawText, e); } catch (ParseException e) { throw new IllegalArgumentException("Invalid expression: " + fullTextSearchExpression, e); } }
@Override public FullTextExpression getFullTextConstraint(SelectorImpl s) { if (!s.equals(selector)) { return null; } PropertyValue v = fullTextSearchExpression.currentValue(); try { String p = propertyName; if (relativePath != null) { if (p == null) { p = "*"; } p = PathUtils.concat(relativePath, p); } String p2 = normalizePropertyName(p); String rawText = getRawText(v); FullTextExpression e = FullTextParser.parse(p2, rawText); return new FullTextContains(p2, rawText, e); } catch (ParseException e) { throw new IllegalArgumentException("Invalid expression: " + fullTextSearchExpression, e); } }