git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1429519 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2013-01-06 13:38:02 +00:00
parent 6db40b852d
commit a347753992
2 changed files with 17 additions and 5 deletions

View File

@ -39,12 +39,15 @@ public class DocumentStoredFieldVisitor extends StoredFieldVisitor {
private final StoredDocument doc = new StoredDocument();
private final Set<String> fieldsToAdd;
/** Load only fields named in the provided <code>Set&lt;String&gt;</code>. */
/**
* Load only fields named in the provided <code>Set&lt;String&gt;</code>.
* @param fieldsToAdd Set of fields to load, or <code>null</code> (all fields).
*/
public DocumentStoredFieldVisitor(Set<String> fieldsToAdd) {
this.fieldsToAdd = fieldsToAdd;
}
/** Load only fields named in the provided <code>Set&lt;String&gt;</code>. */
/** Load only fields named in the provided fields. */
public DocumentStoredFieldVisitor(String... fields) {
fieldsToAdd = new HashSet<String>(fields.length);
for(String field : fields) {

View File

@ -181,17 +181,26 @@ public class IndexSearcher {
return reader;
}
/** Sugar for <code>.getIndexReader().document(docID)</code> */
/**
* Sugar for <code>.getIndexReader().document(docID)</code>
* @see IndexReader#document(int)
*/
public StoredDocument doc(int docID) throws IOException {
return reader.document(docID);
}
/** Sugar for <code>.getIndexReader().document(docID, fieldVisitor)</code> */
/**
* Sugar for <code>.getIndexReader().document(docID, fieldVisitor)</code>
* @see IndexReader#document(int, StoredFieldVisitor)
*/
public void doc(int docID, StoredFieldVisitor fieldVisitor) throws IOException {
reader.document(docID, fieldVisitor);
}
/** Sugar for <code>.getIndexReader().document(docID, fieldsToLoad)</code> */
/**
* Sugar for <code>.getIndexReader().document(docID, fieldsToLoad)</code>
* @see IndexReader#document(int, Set)
*/
public final StoredDocument document(int docID, Set<String> fieldsToLoad) throws IOException {
return reader.document(docID, fieldsToLoad);
}