[
https://issues.apache.org/jira/browse/LUCENE-1483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12657795#action_12657795
]
Mark Miller commented on LUCENE-1483:
-------------------------------------
DocComparator? Its not doing the if's...
Do you mean relevance? That doesn't work right when you can have negatives does
it? This is what I have for Doc (I don't think I've touched it from what you
did):
{code}
public static final class DocComparator extends FieldComparator {
// nocommit -- maybe "setcurrentscoredoc"?
private final int[] docIDs;
private int docBase;
private int readerMaxDoc;
DocComparator(int numHits) {
docIDs = new int[numHits];
}
public int compare(int slot1, int slot2) {
return docIDs[slot1] - docIDs[slot2];
}
public int compare(int slot, int doc, float score) {
return docIDs[slot] - docBase - doc;
}
public void copy(int slot, int doc, float score) {
docIDs[slot] = docBase + doc;
}
public void setNextReader(IndexReader reader) {
// TODO: can we "map" our docIDs to the current
// reader? saves having to then subtract on every
// compare call
docBase += readerMaxDoc;
readerMaxDoc = reader.maxDoc();
}
public int sortType() {
return SortField.DOC;
}
public Comparable value(int slot) {
return new Integer(docIDs[slot]);
}
};
{code}
> Change IndexSearcher to use MultiSearcher semantics for multiple subreaders
> ---------------------------------------------------------------------------
>
> Key: LUCENE-1483
> URL: https://issues.apache.org/jira/browse/LUCENE-1483
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 2.9
> Reporter: Mark Miller
> Priority: Minor
> Attachments: LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch,
> LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch,
> LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch,
> LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch, LUCENE-1483.patch
>
>
> FieldCache and Filters are forced down to a single segment reader, allowing
> for individual segment reloading on reopen.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]