} else { String word = ft.word; if (ft.isPhrase()) { if (quotePhraseWords) { boolean first = true;
boolean isPhrase = ft.isPhrase(); if (!isPhrase) { newFt = ft;
protected static void translateFulltext(FulltextQuery ft, List<String> buf, boolean and) { if (ft.op == Op.OR) { for (FulltextQuery term : ft.terms) { // don't quote words for OR translateFulltext(term, buf, false); } } else if (ft.op == Op.AND) { for (FulltextQuery term : ft.terms) { // quote words for AND translateFulltext(term, buf, true); } } else { String neg; if (ft.op == Op.NOTWORD) { neg = "-"; } else { // Op.WORD neg = ""; } String word = ft.word.toLowerCase(); if (ft.isPhrase() || and) { buf.add(neg + '"' + word + '"'); } else { buf.add(neg + word); } } }
public static boolean hasPhrase(FulltextQuery ft) { if (ft.op == Op.AND || ft.op == Op.OR) { for (FulltextQuery term : ft.terms) { if (hasPhrase(term)) { return true; } } return false; } else { return ft.isPhrase(); } }