Beispiel #1
0
        private void  AddDocumentWithDifferentFields(IndexWriter writer)
        {
            Document doc = new Document();

            doc.Add(Field.Keyword("keyword2", "test1"));
            doc.Add(Field.Text("text2", "test1"));
            doc.Add(Field.UnIndexed("unindexed2", "test1"));
            doc.Add(Field.UnStored("unstored2", "test1"));
            writer.AddDocument(doc);
        }
Beispiel #2
0
        private Document MakeDocumentWithFields()
        {
            Document doc = new Document();

            doc.Add(Field.Keyword("keyword", "test1"));
            doc.Add(Field.Keyword("keyword", "test2"));
            doc.Add(Field.Text("text", "test1"));
            doc.Add(Field.Text("text", "test2"));
            doc.Add(Field.UnIndexed("unindexed", "test1"));
            doc.Add(Field.UnIndexed("unindexed", "test2"));
            doc.Add(Field.UnStored("unstored", "test1"));
            doc.Add(Field.UnStored("unstored", "test2"));
            return(doc);
        }
Beispiel #3
0
 static DocHelper()
 {
     textField1     = Field.Text(TEXT_FIELD_1_KEY, FIELD_1_TEXT, false);
     textField2     = Field.Text(TEXT_FIELD_2_KEY, FIELD_2_TEXT, true);
     keyField       = Field.Keyword(KEYWORD_FIELD_KEY, KEYWORD_TEXT);
     unIndField     = Field.UnIndexed(UNINDEXED_FIELD_KEY, UNINDEXED_FIELD_TEXT);
     unStoredField1 = Field.UnStored(UNSTORED_FIELD_1_KEY, UNSTORED_1_FIELD_TEXT, false);
     unStoredField2 = Field.UnStored(UNSTORED_FIELD_2_KEY, UNSTORED_2_FIELD_TEXT, true);
     {
         nameValues = new System.Collections.Hashtable();
         nameValues[TEXT_FIELD_1_KEY]     = FIELD_1_TEXT;
         nameValues[TEXT_FIELD_2_KEY]     = FIELD_2_TEXT;
         nameValues[KEYWORD_FIELD_KEY]    = KEYWORD_TEXT;
         nameValues[UNINDEXED_FIELD_KEY]  = UNINDEXED_FIELD_TEXT;
         nameValues[UNSTORED_FIELD_1_KEY] = UNSTORED_1_FIELD_TEXT;
         nameValues[UNSTORED_FIELD_2_KEY] = UNSTORED_2_FIELD_TEXT;
     }
 }