Re: Create and populate a field when indexing

2007-11-12 Thread Erick Erickson
Sure, that'd work. It would also work to just continue to use f.getPath() whenever you need it. FWIW Erick On Nov 12, 2007 1:43 PM, KR <[EMAIL PROTECTED]> wrote: > > > Erick Erickson wrote: > > > > Sure, just define it in the same scope as you want to refer to it. > > Of course, that tells you

Re: Create and populate a field when indexing

2007-11-12 Thread KR
Erick Erickson wrote: > > Sure, just define it in the same scope as you want to refer to it. > Of course, that tells you nothing ... > > Java variables go out of scope when the last '}' *at the same level* > is passed. For intance: > > { >string s1; >{ > string s2; >} // s2 i

Re: Create and populate a field when indexing

2007-11-12 Thread Erick Erickson
Sure, just define it in the same scope as you want to refer to it. Of course, that tells you nothing ... Java variables go out of scope when the last '}' *at the same level* is passed. For intance: { string s1; { string s2; } // s2 is out of scope after this line. // s1 is still

Re: Create and populate a field when indexing

2007-11-09 Thread KR
Grant Ingersoll-6 wrote: > > When you are indexing the file and adding the Document, you will need > to parse out your filename per your regular expression, and then > create the appropriate field: > > Document doc = new Document() > String cat = getCategoryFromFileName(inputFileName) > doc

Re: Create and populate a field when indexing

2007-10-29 Thread Grant Ingersoll
When you are indexing the file and adding the Document, you will need to parse out your filename per your regular expression, and then create the appropriate field: Document doc = new Document() String cat = getCategoryFromFileName(inputFileName) doc.add(new Field("category", cat, ...) //do t