Logo Search packages:      
Sourcecode: qt4-x11 version File versions


* Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team
* Distributable under the terms of either the Apache License (Version 2.0) or 
* the GNU Lesser General Public License, as specified in the COPYING file.
#ifndef _lucene_search_TermQuery_
#define _lucene_search_TermQuery_

#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once

#include "SearchHeader.h"
#include "Scorer.h"
#include "CLucene/index/Term.h"
#include "TermScorer.h"
#include "CLucene/index/IndexReader.h"
#include "CLucene/util/StringBuffer.h"
#include "CLucene/index/Terms.h"


    /** A Query that matches documents containing a term.
      This may be combined with other terms with a {@link BooleanQuery}.
00028     class TermQuery: public Query {
            CL_NS(index)::Term* term;

            class TermWeight: public Weight {
                  Searcher* searcher;
                  float_t value;
                  float_t idf;
                  float_t queryNorm;
                  float_t queryWeight;
                  TermQuery* _this;
                  CL_NS(index)::Term* _term;

                  TermWeight(Searcher* searcher, TermQuery* _this, CL_NS(index)::Term* _term);
                  TCHAR* toString();
                  Query* getQuery() { return (Query*)_this; }
                  float_t getValue() { return value; }

                  float_t sumOfSquaredWeights();
                  void normalize(float_t queryNorm);
                  Scorer* scorer(CL_NS(index)::IndexReader* reader);
                  void explain(CL_NS(index)::IndexReader* reader, int32_t doc, Explanation* ret);

        Weight* _createWeight(Searcher* searcher);
        TermQuery(const TermQuery& clone);
            // Constructs a query for the term <code>t</code>. 
            TermQuery(CL_NS(index)::Term* t);

            static const TCHAR* getClassName();
            const TCHAR* getQueryName() const;
            //added by search highlighter
            CL_NS(index)::Term* getTerm(bool pointer=true) const;
            // Prints a user-readable version of this query. 
            TCHAR* toString(const TCHAR* field) const;

            bool equals(Query* other) const;
            Query* clone() const;

            /** Returns a hash code value for this object.*/
            size_t hashCode() const;

Generated by  Doxygen 1.6.0   Back to index