summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2020-05-21 22:22:52 +0200
committerTor Egge <Tor.Egge@broadpark.no>2020-05-21 22:22:52 +0200
commit16307b7549e229d9d93a182975bfb6808ccdd21f (patch)
tree02d9b9753cc0f954ce8bf2efed02d3580d353bcb /searchlib
parent1ca40f19299c6c96273415472f8a9ac3a0d02c28 (diff)
Remove unused field match computer tracing.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/features/fieldmatch/computer.cpp62
-rw-r--r--searchlib/src/vespa/searchlib/features/fieldmatch/computer.h35
-rw-r--r--searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.cpp12
-rw-r--r--searchlib/src/vespa/searchlib/features/fieldmatchfeature.cpp1
4 files changed, 1 insertions, 109 deletions
diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/computer.cpp b/searchlib/src/vespa/searchlib/features/fieldmatch/computer.cpp
index c28f1da291f..43aee8167ee 100644
--- a/searchlib/src/vespa/searchlib/features/fieldmatch/computer.cpp
+++ b/searchlib/src/vespa/searchlib/features/fieldmatch/computer.cpp
@@ -20,8 +20,6 @@ Computer::Computer(const vespalib::string &propertyNamespace, const PhraseSplitt
_splitter(splitter),
_fieldId(fieldInfo.id()),
_params(params),
- _tracing(false),
- _trace(),
_useCachedHits(true),
_queryTerms(),
_queryTermFieldMatch(),
@@ -250,27 +248,6 @@ Computer::fieldIndexToSemanticDistance(int j, uint32_t zeroJ) const
}
}
-Computer &
-Computer::trace(const vespalib::string &str)
-{
- if (_tracing) {
- _trace.push_back(str);
- //LOG(info, "%s", str.c_str());
- }
- return *this;
-}
-
-vespalib::string
-Computer::getTrace() const
-{
- vespalib::string ret = "";
- for (std::vector<vespalib::string>::const_iterator it = _trace.begin();
- it != _trace.end(); ++it) {
- ret += *it;
- }
- return ret;
-}
-
vespalib::string
Computer::toString() const
{
@@ -282,41 +259,13 @@ Computer::toString() const
void
Computer::exploreSegments()
{
- if (isTracing()) {
- trace(vespalib::make_string("Calculating matches for %d query terms, %d field terms.",
- getNumQueryTerms(), _fieldLength));
- }
-
_segments[0].segment->reset(_currentMetrics);
_segments[0].valid = true;
SegmentStart *segment = _segments[0].segment.get();
while (segment != nullptr) {
- if (isTracing()) {
- trace(vespalib::make_string("Looking for segment from %s...",
- segment->toString().c_str()));
- }
-
_currentMetrics = segment->getMetrics(); // take a copy of the segment returned from the current segment.
bool found = findAlternativeSegmentFrom(segment);
- if (found) {
- if (isTracing()) {
- vespalib::string segments = "[ ";
- const std::vector<uint32_t> &lst = _currentMetrics.getSegmentStarts();
- for (uint32_t i = 0; i < lst.size(); ++i) {
- segments += vespalib::make_string("%d", lst[i]);
- if (i < lst.size() - 1) {
- segments += ", ";
- }
- }
- segments += " ]";
- trace(vespalib::make_string("...found segments: %s, score %f.",
- segments.c_str(),
- _currentMetrics.getSegmentationScore()));
- }
- } else {
- if (isTracing()) {
- trace("...no complete and improved segment existed.");
- }
+ if (!found) {
segment->setOpen(false);
}
segment = findOpenSegment(segment->getI());
@@ -404,9 +353,6 @@ Computer::inSegment(int i, int j, int previousJ, int previousI)
}
else {
_currentMetrics.onInSegmentGap(i, j, previousJ);
- if (isTracing()) {
- trace(vespalib::make_string(" in segment gap: %d -> %d", i, j));
- }
}
}
@@ -417,18 +363,12 @@ Computer::segmentStart(int i, int j, int previousJ)
if (previousJ >= 0) {
_currentMetrics.onPair(i, j, previousJ);
}
- if (isTracing()) {
- trace(vespalib::make_string(" new segment at: %d -> %d", i, j));
- }
return true;
}
void
Computer::segmentEnd(int i, int j)
{
- if (isTracing()) {
- trace(vespalib::make_string(" segment ended at: %d -> %d", i, j));
- }
SegmentStart *startOfNext = _segments[i + 1].segment.get();
if (!_segments[i + 1].valid) {
startOfNext->reset(_currentMetrics, j, i + 1);
diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h b/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h
index b40b27596dc..b2644208b40 100644
--- a/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h
+++ b/searchlib/src/vespa/searchlib/features/fieldmatch/computer.h
@@ -148,39 +148,6 @@ public:
}
/**
- * Adds the given string to the trace of this, if tracing is enabled.
- *
- * @param str The string to trace.
- * @return This, to allow chaining.
- */
- Computer &trace(const vespalib::string &str);
-
- /**
- * Returns a textual trace of the last execution of this algorithm, if tracing is on.
- *
- * @return The trace string.
- */
- vespalib::string getTrace() const;
-
- /**
- * Set to true to collect a textual trace from the computation, which can be retrieved using {@link #getTrace}.
- *
- * @param tracing Whether or not to trace.
- * @return This, to allow chaining.
- */
- Computer &setTracing(bool tracing) {
- _tracing = tracing;
- return *this;
- }
-
- /**
- * Returns whether tracing is on.
- *
- * @return True if tracing is on.
- */
- bool isTracing() const { return _tracing; }
-
- /**
* Returns the number of terms searching on this field.
*
* @return The number of terms.
@@ -332,8 +299,6 @@ private:
const search::fef::PhraseSplitter & _splitter;
uint32_t _fieldId;
Params _params;
- bool _tracing;
- std::vector<vespalib::string> _trace;
bool _useCachedHits;
QueryTermVector _queryTerms;
diff --git a/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.cpp b/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.cpp
index 82f2beeea32..6f99bbfab14 100644
--- a/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.cpp
+++ b/searchlib/src/vespa/searchlib/features/fieldmatch/segmentstart.cpp
@@ -46,12 +46,6 @@ bool
SegmentStart::offerHistory(int previousJ, const Metrics & metrics)
{
if (metrics.getSegmentationScore() <= _metrics.getSegmentationScore()) {
- if (_owner->isTracing()) {
- _owner->trace(vespalib::make_string(" Rejected offered history [score %f, ending at %d] at %s.\n",
- metrics.getSegmentationScore(),
- previousJ,
- toString().c_str()));
- }
return false; // reject
}
@@ -64,12 +58,6 @@ SegmentStart::offerHistory(int previousJ, const Metrics & metrics)
}
#endif
- if (_owner->isTracing()) {
- _owner->trace(vespalib::make_string(" Accepted offered history [score %f, ending at %d] at %s.\n",
- metrics.getSegmentationScore(),
- previousJ,
- toString().c_str()));
- }
_previousJ = previousJ;
_metrics = metrics; // take a copy of the given metrics
return true; // accept
diff --git a/searchlib/src/vespa/searchlib/features/fieldmatchfeature.cpp b/searchlib/src/vespa/searchlib/features/fieldmatchfeature.cpp
index de79280517d..62b5f1d8165 100644
--- a/searchlib/src/vespa/searchlib/features/fieldmatchfeature.cpp
+++ b/searchlib/src/vespa/searchlib/features/fieldmatchfeature.cpp
@@ -55,7 +55,6 @@ FieldMatchExecutor::execute(uint32_t docId)
_splitter.update();
_cmp.reset(docId);
- //_cmp.setTracing(true);
const fieldmatch::SimpleMetrics & simple = _cmp.getSimpleMetrics();