(index) Consume the new 'body' span in index to make it used in ranking

This commit is contained in:
Viktor Lofgren 2024-08-15 08:33:43 +02:00
parent 75b0888032
commit dbc6a95276
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,7 @@ public class DocumentSpans {
public DocumentSpan title = EMPTY_SPAN;
public DocumentSpan heading = EMPTY_SPAN;
public DocumentSpan body = EMPTY_SPAN;
public DocumentSpan nav = EMPTY_SPAN;
public DocumentSpan code = EMPTY_SPAN;
@ -28,6 +29,9 @@ public class DocumentSpans {
return anchor;
else if (tag == HtmlTag.EXTERNAL_LINKTEXT)
return externalLinkText;
else if (tag == HtmlTag.BODY)
return body;
return EMPTY_SPAN;
}
@ -44,6 +48,8 @@ public class DocumentSpans {
this.anchor = new DocumentSpan(positions);
else if (code == HtmlTag.EXTERNAL_LINKTEXT.code)
this.externalLinkText = new DocumentSpan(positions);
else if (code == HtmlTag.BODY.code)
this.body = new DocumentSpan(positions);
}
}

View File

@ -192,8 +192,6 @@ public class IndexResultScoreCalculator {
VerbatimMatches verbatimMatches = new VerbatimMatches();
float verbatimMatchScore = findVerbatimMatches(verbatimMatches, coherences, positions, spans);
float[] weightedCounts = new float[compiledQuery.size()];