[Xapian-tickets] [Xapian] #803: Snippet generator crashes on empty query
Xapian
nobody at xapian.org
Wed Apr 8 03:26:53 BST 2020
#803: Snippet generator crashes on empty query
-----------------------------+-------------------------------
Reporter: Robert Stepanek | Owner: Olly Betts
Type: defect | Status: assigned
Priority: normal | Milestone:
Component: Other | Version:
Severity: normal | Resolution:
Keywords: | Blocked By:
Blocking: | Operating System: All
-----------------------------+-------------------------------
Comment (by Olly Betts):
Candidate fix:
{{{
--- a/xapian-core/queryparser/termgenerator_internal.cc
+++ b/xapian-core/queryparser/termgenerator_internal.cc
@@ -827,6 +827,10 @@ MSet::Internal::snippet(const string & text,
max_tw *= 1.015625;
}
+ Xapian::Query query;
+ if (enquire.get()) {
+ query = enquire->query;
+ }
SnipPipe snip(length);
list<vector<string>> exact_phrases;
@@ -834,7 +838,7 @@ MSet::Internal::snippet(const string & text,
list<const Xapian::Internal::QueryWildcard*> wildcards;
list<const Xapian::Internal::QueryEditDistance*> fuzzies;
size_t longest_phrase = 0;
- check_query(enquire->query, exact_phrases, loose_terms,
+ check_query(query, exact_phrases, loose_terms,
wildcards, fuzzies, longest_phrase);
vector<double> exact_phrases_relevance;
}}}
--
Ticket URL: <https://trac.xapian.org/ticket/803#comment:2>
Xapian <https://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list