Commit 849749e5 authored by reuschling's avatar reuschling
Browse files

bugfix: disable termrelevances at simpleindexinterface


git-svn-id: https://dynaq.opendfki.de/repos/application/trunk@1058 8b50620d-ddf8-0310-9f5d-8b2f31fd9ac4
parent fbf9e22e
......@@ -751,7 +751,7 @@ public class DynaQResultList implements Iterable<ScoredDynaQDocument>
// wir schalten das injizierte Flag für die Termrelevanzen scharf
if(termRelevanceExplanations) TermRelevancesCollector.enableTermRelevanceExplanations(query4All);
TermRelevancesCollector.setTermRelevanceExplanations(query4All, termRelevanceExplanations);
......
......@@ -132,14 +132,14 @@ public class TermRelevancesCollector
// wenn für diese Query gar keine TermRelevances enabled ist, dann mache mer gar nix
if(((TermRelevancesQuery) query4Weight).isTermRelevancesEnabled() == false) return;
System.err.println("chris: " + "after search: " + query4Weight.toString());
System.err.println("chris: " + LoggingUtils.getCurrentStackTrace());
// System.err.println("chris: " + "after search: " + query4Weight.toString());
// System.err.println("chris: " + LoggingUtils.getCurrentStackTrace());
// TODO brauche ich diesen zweiten Durchlauf noch? Oder habe ich es mit dem Doppeleintrag bei afterScore erschlagen? Ich vermute es geht, wenn ich den bulkscorer
// noch geweaved habe... CHECK
// rekursives enablen
enableTermRelevanceExplanations(query4Weight);
setTermRelevanceExplanations(query4Weight, true);
IndexReader indexReader = ((IndexSearcher) searcher).getIndexReader();
......@@ -209,8 +209,9 @@ public class TermRelevancesCollector
* Enables term relevance collecting for a query Object. In the case it is a BooleanQuery or a FilteredQuery, all underlying queries will be enabled recursively
*
* @param query the query
* @param bEnableTermRelevances true: enabled, false: disabled
*/
static public void enableTermRelevanceExplanations(Query query)
static public void setTermRelevanceExplanations(Query query, boolean bEnableTermRelevances)
{
if(query == null) return;
......@@ -227,15 +228,15 @@ public class TermRelevancesCollector
if(query instanceof BooleanQuery)
{
for (BooleanClause clause : ((BooleanQuery) query).getClauses())
enableTermRelevanceExplanations(clause.getQuery());
setTermRelevanceExplanations(clause.getQuery(), bEnableTermRelevances);
}
if(query instanceof FilteredQuery)
{
enableTermRelevanceExplanations(((FilteredQuery) query).getQuery());
setTermRelevanceExplanations(((FilteredQuery) query).getQuery(), bEnableTermRelevances);
}
((TermRelevancesQuery) query).enableTermRelevances(true);
((TermRelevancesQuery) query).enableTermRelevances(bEnableTermRelevances);
}
......
......@@ -1658,7 +1658,7 @@ public class SimpleIndexInterface
resultList = new DynaQResultList(dynaqQuery, m_luceneIndexSet, iTopDocs2Collect);
resultList.termRelevanceExplanations = false;
System.err.println("chris: " + "termRelevanceExplanations set to false");
// System.err.println("chris: " + "termRelevanceExplanations set to false");
if(!StringUtils.nullOrWhitespace(strFieldName4Sorting) && bReverse != null)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment