also, for quick reference you can take a look to the test code,

                private Lucene.Net.Documents.Document MakeDocumentWithFields()
                {
                        Lucene.Net.Documents.Document doc = new 
Lucene.Net.Documents.Document();
                        doc.Add(new Field("keyword", "test1", Field.Store.YES,
Field.Index.UN_TOKENIZED));
                        doc.Add(new Field("keyword", "test2", Field.Store.YES,
Field.Index.UN_TOKENIZED));
                        doc.Add(new Field("text", "test1", Field.Store.YES, 
Field.Index.TOKENIZED));
                        doc.Add(new Field("text", "test2", Field.Store.YES, 
Field.Index.TOKENIZED));
                        doc.Add(new Field("unindexed", "test1", 
Field.Store.YES, Field.Index.NO));
                        doc.Add(new Field("unindexed", "test2", 
Field.Store.YES, Field.Index.NO));
                        doc.Add(new Field("unstored", "test1", Field.Store.NO,
Field.Index.TOKENIZED));
                        doc.Add(new Field("unstored", "test2", Field.Store.NO,
Field.Index.TOKENIZED));
                        return doc;
                }


On 10/9/07, Jokin Cuadrado <[EMAIL PROTECTED]> wrote:
> where do you get that code?
>
> the way for adding fields to document is:
>
> Field myField = New Field("CW", strings 0], Field.Store.YES,
> Field.Index.UN_TOKENIZED);
> doc.Add(myField);
>
> On 10/9/07, Karl Geppert <[EMAIL PROTECTED]> wrote:
> > Okay - this is probably a dumb question, but I'll ask a style question
> > here also to help;
> >
> > I want to build an index of chemical names and associated numbers with
> > them in lucene.  I'm using the below code extract but when I come to the
> > code to add the Field.Keyword and Field.Text to the index, the compiler
> > tells me that
> >
> > [C# Error] WinForm.cs(110): 'Lucene.Net.Documents.Field' does not
> > contain a definition for 'Keyword'
> > [C# Error] WinForm.cs(111): 'Lucene.Net.Documents.Field' does not
> > contain a definition for 'Text'
> >
>

Reply via email to