org.apache.lucene.document
public class: MapFieldSelector [javadoc |
source]
java.lang.Object
org.apache.lucene.document.MapFieldSelector
All Implemented Interfaces:
FieldSelector
A FieldSelector based on a Map of field names to FieldSelectorResults
| Field Summary |
|---|
| Map | fieldSelections | |
| Constructor: |
public MapFieldSelector(Map fieldSelections) {
this.fieldSelections = fieldSelections;
}
Create a a MapFieldSelector Parameters:
fieldSelections - maps from field names (String) to FieldSelectorResults
|
public MapFieldSelector(List fields) {
fieldSelections = new HashMap(fields.size()*5/3);
for (int i=0; i< fields.size(); i++)
fieldSelections.put(fields.get(i), FieldSelectorResult.LOAD);
}
Create a a MapFieldSelector Parameters:
fields - fields to LOAD. List of Strings. All other fields are NO_LOAD.
|
public MapFieldSelector(String[] fields) {
fieldSelections = new HashMap(fields.length*5/3);
for (int i=0; i< fields.length; i++)
fieldSelections.put(fields[i], FieldSelectorResult.LOAD);
}
Create a a MapFieldSelector Parameters:
fields - fields to LOAD. All other fields are NO_LOAD.
|
| Method from org.apache.lucene.document.MapFieldSelector Summary: |
|---|
|
accept |
| Method from org.apache.lucene.document.MapFieldSelector Detail: |
public FieldSelectorResult accept(String field) {
FieldSelectorResult selection = (FieldSelectorResult) fieldSelections.get(field);
return selection!=null ? selection : FieldSelectorResult.NO_LOAD;
}
Load field according to its associated value in fieldSelections |