@@ -0,0 +1,901 @@
+package ka.kaznu.lucene.index;%0A%0Aimport org.apache.lucene.document.Document;%0Aimport org.apache.lucene.document.Field;%0Aimport org.apache.lucene.document.FieldType;%0A%0A/**%0A * We will use this class to convert messages to Lucene documents%0A */%0Apublic class MessageToDocument %7B%0A%0A    /**%0A     * Creates Lucene Document using two strings: body and title%0A     *%0A     * @return resulted document%0A     */%0A    public static Document createWith(final String titleStr, final String bodyStr) %7B%0A        final Document document = new Document();%0A%0A        final FieldType textIndexedType = new FieldType();%0A        textIndexedType.setTokenized(true);%0A%0A        //index title%0A        Field title = new Field(%22title%22, titleStr, textIndexedType);%0A        //index body%0A        Field body = new Field(%22body%22, bodyStr, textIndexedType);%0A%0A        document.add(title);%0A        document.add(body);%0A        return document;%0A    %7D%0A%7D%0A

Create MessageToDocument class that we will use for creating Lucene Document from strings