lucene/lucene-directory/src/test/java/org/infinispan/lucene/CacheTestSupport.java
/**
    * Used in test to add a new Document to an Index; two fields are created: id and body
    *
    * @param dir The Directory containing the Index to modify
    * @param id a sequential number to identify this document (id field)
    * @param text Some text to add to the body field
    * @throws IOException
    */
Used in test to add a new Document to an Index; two fields are created: id and body
@param dir The Directory containing the Index to modify
@param id a sequential number to identify this document (id field)
@param text Some text to add to the body field
@throws IOException
Used in test to add a new Document to an Index ; two fields are created : id and body @param dir The Directory containing the Index to modify @param id a sequential number to identify this document ( id field ) @param text Some text to add to the body field @throws IOException
public static void writeTextToIndex(Directory dir, int id, String text) throws IOException {
      IndexWriterConfig indexWriterConfig = new IndexWriterConfig(LuceneSettings.analyzer);
      IndexWriter iw = new IndexWriter(dir, indexWriterConfig);
      Document doc = new Document();
      doc.add(new StringField("id", String.valueOf(id), Field.Store.YES));
      doc.add(new TextField("body", text, Field.Store.NO));
      iw.addDocument(doc);
      iw.commit();
      iw.close();
   }
public static void writeTextToIndex ( Directory dir , int id , String text ) throws IOException { IndexWriterConfig indexWriterConfig = new IndexWriterConfig ( LuceneSettings . analyzer ) ; IndexWriter iw = new IndexWriter ( dir , indexWriterConfig ) ; Document doc = new Document ( ) ; doc . add ( new StringField ( "id" , String . valueOf ( id ) , Field . Store . YES ) ) ; doc . add ( new TextField ( "body" , text , Field . Store . NO ) ) ; iw . addDocument ( doc ) ; iw . commit ( ) ; iw . close ( ) ; }
Used in test to add a new Document to an Index; two fields are created: id and body
 @param dir The Directory containing the Index to modify
 @param id a sequential number to identify this document (id field)
 @param text Some text to add to the body field
 @throws IOException
Used in test to add a new Document to an Index ; two fields are created : id and body @param dir The Directory containing the Index to modify @param id a sequential number to identify this document ( id field ) @param text Some text to add to the body field @throws IOException