Example usage for org.apache.lucene.benchmark.byTask.feeds DocData setID

List of usage examples for org.apache.lucene.benchmark.byTask.feeds DocData setID

Introduction

In this page you can find the example usage for org.apache.lucene.benchmark.byTask.feeds DocData setID.

Prototype

public void setID(int id) 

Source Link

Usage

From source file:com.tamingtext.qa.WexWikiContentSource.java

License:Apache License

@Override
public DocData getNextDocData(DocData docData) throws NoMoreDataException, IOException {
    if (ir == null) {
        ir = getReader(file);/*from  w ww  .  jav a  2  s.co m*/
    }

    String[] tuple = parser.next();
    if (tuple == null)
        return null;

    docData.clear();
    docData.setID(Integer.parseInt(tuple[ID]));
    docData.setTitle(tuple[TITLE]);
    docData.setBody(tuple[BODY]);
    docData.setDate(tuple[DATE]);

    props.setProperty("category", tuple[CATEGORY]);
    docData.setProps(props);

    return docData;
}