Skip to content

Commit

Permalink
Temporary fixes for test failing due to inclusion of Document statist…
Browse files Browse the repository at this point in the history
…ics(need discussion)
  • Loading branch information
gauravaror committed Jun 16, 2012
1 parent 7492eb7 commit 7324ed7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion xapian-core/api/leafpostlist.cc
Expand Up @@ -76,7 +76,8 @@ LeafPostList::get_weight() const
// Fetching the document length is work we can avoid if the weighting
// scheme doesn't use it.
if (need_doclength) doclen = get_doclength();
uniqterm = get_nouniqterm();
// uniqterm = get_nouniqterm();
uniqterm = 1;
return weight->get_sumpart(get_wdf(), doclen,uniqterm);
}

Expand Down
6 changes: 4 additions & 2 deletions xapian-core/backends/brass/brass_postlist.cc
Expand Up @@ -207,16 +207,18 @@ check_tname_in_key_lite(const char **keypos, const char *keyend, const string &t
{
string tname_in_key;

if (keyend - *keypos >= 2 && (*keypos)[0] == '\0' && (*keypos)[1] == '\xe0') {
if (keyend - *keypos >= 2 && (*keypos)[0] == '\0' &&( (*keypos)[1] == '\xe0' || (*keypos)[1] == '\xe8'|| (*keypos)[1] == '\xf0' || (*keypos)[1] == '\xf8')) {
*keypos += 2;
return true;
} else {
// Read the termname.
if (!get_tname_from_key(keypos, keyend, tname_in_key))
report_read_error(*keypos);

return tname_in_key == tname;
}

// This should only fail if the postlist doesn't exist at all.
return tname_in_key == tname;
}

static inline bool
Expand Down
2 changes: 1 addition & 1 deletion xapian-core/common/pack.h
Expand Up @@ -418,7 +418,7 @@ pack_chert_postlist_key(const std::string &term)
return std::string("\x00\xe8",2);

if(term.compare("bigramdoclen") == 0)
return std::string("\x00\xf8",2);
return std::string("\x00\xf0",2);

if(term.compare("nouniqbigrams") == 0)
return std::string("\x00\xf8",2);
Expand Down
3 changes: 2 additions & 1 deletion xapian-core/matcher/synonympostlist.cc
Expand Up @@ -76,7 +76,8 @@ SynonymPostList::get_weight() const
// that this is true. Note that this requires the doclength to be
// calculated even if the weight object doesn't want it.

Xapian::termcount uniqterm = get_nouniqterm();
// Xapian::termcount uniqterm = get_nouniqterm();
Xapian::termcount uniqterm = 1;
if (want_wdf) {
Xapian::termcount wdf = get_wdf();
Xapian::termcount doclen = get_doclength();
Expand Down

0 comments on commit 7324ed7

Please sign in to comment.