mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 05:18:58 +00:00
(index) Consume the new 'body' span in index to make it used in ranking
This commit is contained in:
parent
75b0888032
commit
dbc6a95276
@ -8,6 +8,7 @@ public class DocumentSpans {
|
|||||||
|
|
||||||
public DocumentSpan title = EMPTY_SPAN;
|
public DocumentSpan title = EMPTY_SPAN;
|
||||||
public DocumentSpan heading = EMPTY_SPAN;
|
public DocumentSpan heading = EMPTY_SPAN;
|
||||||
|
public DocumentSpan body = EMPTY_SPAN;
|
||||||
|
|
||||||
public DocumentSpan nav = EMPTY_SPAN;
|
public DocumentSpan nav = EMPTY_SPAN;
|
||||||
public DocumentSpan code = EMPTY_SPAN;
|
public DocumentSpan code = EMPTY_SPAN;
|
||||||
@ -28,6 +29,9 @@ public class DocumentSpans {
|
|||||||
return anchor;
|
return anchor;
|
||||||
else if (tag == HtmlTag.EXTERNAL_LINKTEXT)
|
else if (tag == HtmlTag.EXTERNAL_LINKTEXT)
|
||||||
return externalLinkText;
|
return externalLinkText;
|
||||||
|
else if (tag == HtmlTag.BODY)
|
||||||
|
return body;
|
||||||
|
|
||||||
return EMPTY_SPAN;
|
return EMPTY_SPAN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,6 +48,8 @@ public class DocumentSpans {
|
|||||||
this.anchor = new DocumentSpan(positions);
|
this.anchor = new DocumentSpan(positions);
|
||||||
else if (code == HtmlTag.EXTERNAL_LINKTEXT.code)
|
else if (code == HtmlTag.EXTERNAL_LINKTEXT.code)
|
||||||
this.externalLinkText = new DocumentSpan(positions);
|
this.externalLinkText = new DocumentSpan(positions);
|
||||||
|
else if (code == HtmlTag.BODY.code)
|
||||||
|
this.body = new DocumentSpan(positions);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -192,8 +192,6 @@ public class IndexResultScoreCalculator {
|
|||||||
|
|
||||||
VerbatimMatches verbatimMatches = new VerbatimMatches();
|
VerbatimMatches verbatimMatches = new VerbatimMatches();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float verbatimMatchScore = findVerbatimMatches(verbatimMatches, coherences, positions, spans);
|
float verbatimMatchScore = findVerbatimMatches(verbatimMatches, coherences, positions, spans);
|
||||||
|
|
||||||
float[] weightedCounts = new float[compiledQuery.size()];
|
float[] weightedCounts = new float[compiledQuery.size()];
|
||||||
|
Loading…
Reference in New Issue
Block a user