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_PrefixQuery
#define _lucene_search_PrefixQuery
#if defined(_LUCENE_PRAGMA_ONCE)
# pragma once

#include "CLucene/index/Term.h"
#include "CLucene/index/Terms.h"
#include "CLucene/index/IndexReader.h"
#include "SearchHeader.h"
#include "BooleanQuery.h"
#include "TermQuery.h"
#include "CLucene/util/StringBuffer.h"

      //PrefixQuery is a Query that matches documents containing terms with a specified prefix.

      class PrefixQuery: public Query {
            CL_NS(index)::Term* prefix;
            PrefixQuery(const PrefixQuery& clone);

            //Constructor. Constructs a query for terms starting with prefix
            PrefixQuery(CL_NS(index)::Term* Prefix);


            //Returns the name "PrefixQuery"
            const TCHAR* getQueryName() const;
            static const TCHAR* getClassName();

            /** Returns the prefix of this query. */
            CL_NS(index)::Term* getPrefix(bool pointer=true);

            Query* combine(Query** queries);
            Query* rewrite(CL_NS(index)::IndexReader* reader);
            Query* clone() const;
            bool equals(Query * other) const;

            //Creates a user-readable version of this query and returns it as as string
            TCHAR* toString(const TCHAR* field) const;

            size_t hashCode() const;
    class PrefixFilter: public Filter 
      CL_NS(index)::Term* prefix;
      PrefixFilter( const PrefixFilter& copy );
      PrefixFilter(CL_NS(index)::Term* prefix);
      /** Returns a BitSet with true for documents which should be permitted in
      search results, and false for those that should not. */
      CL_NS(util)::BitSet* bits( CL_NS(index)::IndexReader* reader );
      Filter* clone() const;
      TCHAR* toString();

Generated by  Doxygen 1.6.0   Back to index