Added number of terms to consider in more_like_this when using ELITE_SET

This commit is contained in:
David Sauve 2010-05-28 14:41:09 -04:00
parent e4707203f4
commit 28d7284205
1 changed files with 6 additions and 4 deletions

View File

@ -469,9 +469,11 @@ class SearchBackend(BaseSearchBackend):
for match in self._get_enquire_mset(database, enquire, 0, end_offset):
rset.add_document(match.docid)
query = xapian.Query(xapian.Query.OP_ELITE_SET,
[expand.term for expand in enquire.get_eset(match.document.termlist_count(), rset, XHExpandDecider())]
query = xapian.Query(
xapian.Query.OP_ELITE_SET,
[expand.term for expand in enquire.get_eset(match.document.termlist_count(), rset, XHExpandDecider())],
match.document.termlist_count()
)
query = xapian.Query(
xapian.Query.OP_AND_NOT, [query, DOCUMENT_ID_TERM_PREFIX + get_identifier(model_instance)]
@ -503,7 +505,7 @@ class SearchBackend(BaseSearchBackend):
results.append(
SearchResult(app_label, module_name, pk, match.percent, weight=match.weight, **model_data)
)
return {
'results': results,
'hits': matches.get_matches_estimated(),