Lucene++ - a full-featured, c++ search engine
API Documentation

Loading...
Searching...
No Matches
Term.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 Alan Wright. All rights reserved.
3// Distributable under the terms of either the Apache License (Version 2.0)
4// or the GNU Lesser General Public License.
6
7#ifndef TERM_H
8#define TERM_H
9
10#include "LuceneObject.h"
11
12 namespace Lucene {
13
20 class LPPAPI Term : public LuceneObject {
21 public:
23 Term(const String& fld, const String& txt = EmptyString);
24 virtual ~Term();
25
26 LUCENE_CLASS(Term);
27
28 public:
29 String _field;
30 String _text;
31
32 public:
35 String field();
36
39 String text();
40
44 TermPtr createTerm(const String& text);
45
46 virtual bool equals(const LuceneObjectPtr& other);
47 virtual int32_t hashCode();
48
53 virtual int32_t compareTo(const LuceneObjectPtr& other);
54
55 void set(const String& fld, const String& txt);
56
57 virtual String toString();
58};
59
60}
61
62#endif
LuceneObject.h
LUCENE_CLASS
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Lucene::LuceneObject
Base class for all Lucene classes.
Definition LuceneObject.h:31
Lucene::Term
A Term represents a word from text. This is the unit of search. It is composed of two elements,...
Definition Term.h:20
Lucene::Term::~Term
virtual ~Term()
Lucene::Term::set
void set(const String &fld, const String &txt)
Lucene::Term::createTerm
TermPtr createTerm(const String &text)
Optimized construction of new Terms by reusing same field as this Term.
Lucene::Term::equals
virtual bool equals(const LuceneObjectPtr &other)
Return whether two objects are equal.
Lucene::Term::compareTo
virtual int32_t compareTo(const LuceneObjectPtr &other)
Compares two terms, returning a negative integer if this term belongs before the argument,...
Lucene::Term::Term
Term(const String &fld, const String &txt=EmptyString)
Constructs a Term with the given field and text.
Lucene::Term::_text
String _text
Definition Term.h:30
Lucene::Term::_field
String _field
Definition Term.h:29
Lucene::Term::text
String text()
Returns the text of this term. In the case of words, this is simply the text of the word....
Lucene::Term::toString
virtual String toString()
Returns a string representation of the object.
Lucene::Term::field
String field()
Returns the field of this term, an interned string. The field indicates the part of a document which ...
Lucene::Term::hashCode
virtual int32_t hashCode()
Return hash code for this object.
Lucene
Definition AbstractAllTermDocs.h:12
Lucene::LuceneObjectPtr
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
Lucene::TermPtr
boost::shared_ptr< Term > TermPtr
Definition LuceneTypes.h:233

clucene.sourceforge.net