QCLuceneQuery* QCLuceneMultiFieldQueryParser::parse(const QString &query,
                                                    const QStringList &fieldList,
                                                    QCLuceneAnalyzer &analyzer)
{
    QCLuceneBooleanQuery *retValue = new QCLuceneBooleanQuery();
    foreach (const QString &field, fieldList) {
        QCLuceneQuery *q = QCLuceneQueryParser::parse(query, field, analyzer);
        if (!q) {
            delete retValue;
            retValue = 0; break;
        } else {
            retValue->add(q, true, false, false);
        }
    }
bool QHelpSearchIndexReaderClucene::addWithoutQuery(const QHelpSearchQuery &query,
    const QString &fieldName, QCLuceneBooleanQuery &booleanQuery)
{
    bool queryIsValid = false;
    const QStringList &stopWords = QCLuceneStopAnalyzer().englishStopWords();
    foreach (const QString &term, query.wordList) {
        if (stopWords.contains(term, Qt::CaseInsensitive))
            continue;
        QCLuceneQuery *lQuery = new QCLuceneTermQuery(QCLuceneTerm(
                fieldName, term.toLower()));
        booleanQuery.add(lQuery, true, false, true);
        queryIsValid = true;
    }
    return queryIsValid;
}
bool QHelpSearchIndexReaderClucene::addPhraseQuery(const QHelpSearchQuery &query,
    const QString &fieldName, QCLuceneBooleanQuery &booleanQuery)
{
    bool queryIsValid = false;
    const QString &term = query.wordList.at(0).toLower();
    if (term.contains(QLatin1Char(' '))) {
        const QStringList termList = term.split(QLatin1String(" "));
        QCLucenePhraseQuery *q = new QCLucenePhraseQuery();
        const QStringList stopWords = QCLuceneStopAnalyzer().englishStopWords();
        foreach (const QString &term, termList) {
            if (!stopWords.contains(term, Qt::CaseInsensitive))
                q->addTerm(QCLuceneTerm(fieldName, term.toLower()));
        }
        if (!q->getTerms().isEmpty()) {
            booleanQuery.add(q, true, true, false);
            queryIsValid = true;
        }
    } else {
bool QHelpSearchIndexReaderClucene::addFuzzyQuery(const QHelpSearchQuery &query,
    const QString &fieldName, QCLuceneBooleanQuery &booleanQuery,
    QCLuceneAnalyzer &analyzer)
{
    bool queryIsValid = false;
    const QLatin1String fuzzy("~");
    foreach (const QString &term, query.wordList) {
        if (!term.isEmpty()) {
            QCLuceneQuery *lQuery =
                    QCLuceneQueryParser::parse(term + fuzzy, fieldName, analyzer);
            if (lQuery != 0) {
                booleanQuery.add(lQuery, true, false, false);
                queryIsValid = true;
            }
        }
    }
    return queryIsValid;
}