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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
NearSpansOrdered.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 NEARSPANSORDERED_H
8 #define NEARSPANSORDERED_H
9 
10 #include "Spans.h"
11 
12 namespace Lucene {
13 
31 class LPPAPI NearSpansOrdered : public Spans {
32 public:
33  NearSpansOrdered(const SpanNearQueryPtr& spanNearQuery, const IndexReaderPtr& reader, bool collectPayloads = true);
34  virtual ~NearSpansOrdered();
35 
37 
38 protected:
39  int32_t allowedSlop;
40  bool firstTime;
41  bool more;
42 
45 
47  bool inSameDoc;
48 
49  int32_t matchDoc;
50  int32_t matchStart;
51  int32_t matchEnd;
53 
57 
58 public:
59  virtual int32_t doc();
60  virtual int32_t start();
61  virtual int32_t end();
62 
63  Collection<SpansPtr> getSubSpans();
64 
65  virtual Collection<ByteArray> getPayload();
66  virtual bool isPayloadAvailable();
67  virtual bool next();
68  virtual bool skipTo(int32_t target);
69 
73  static bool docSpansOrdered(const SpansPtr& spans1, const SpansPtr& spans2);
74 
75  virtual String toString();
76 
77 protected:
81  bool advanceAfterOrdered();
82 
84  bool toSameDoc();
85 
86  // Like {@link #docSpansOrdered(SpansPtr, SpansPtr)}, but use the spans starts and ends as parameters.
87  static bool docSpansOrdered(int32_t start1, int32_t end1, int32_t start2, int32_t end2);
88 
90  bool stretchToOrder();
91 
94  bool shrinkToAfterShortestMatch();
95 };
96 
97 }
98 
99 #endif

clucene.sourceforge.net