Re: Multiple values in field

2008-10-27 Thread agatone
I just hope indexing one extra field isn't gonna be performance issue later. Ty for your replies. Erick Erickson wrote: > > then you'll need to index another field that records that intention, or > just "know" which fields are intended to be multiple. > > Best > Erick > > On Sat, Oct 25, 200

Re: Multiple values in field

2008-10-27 Thread Erick Erickson
then you'll need to index another field that records that intention, or just "know" which fields are intended to be multiple. Best Erick On Sat, Oct 25, 2008 at 4:12 AM, agatone <[EMAIL PROTECTED]> wrote: > > Yeah but if it happens that for a certain document field1 has only one > value > and in

Re: Multiple values in field

2008-10-25 Thread agatone
Yeah but if it happens that for a certain document field1 has only one value and in that case I can't know it is intended as a multiple. in that case adds.size() would be == 1 and it would look as normal field. What i need is to mark that field is intended to be multiple no matter if it contains

Re: Multiple values in field

2008-10-24 Thread Erick Erickson
No, no, no... Say you have the following Document doc = new Document() doc.add("field1", "stuff", blah, blah) doc.add("field1", "more stuff", blah, blah) doc.add("field1", "stuff and nonsense", blah, blah) IndexWriter.addDocument(doc) Now, in your search code that document comes up as a hit an

Re: Multiple values in field

2008-10-24 Thread agatone
That sounds like abuse of Document.add() :) Ok, so adding first one extra "empty" value for every field i wish to mark as multi. Well if that ain't so wrong, I'll use that :) Ty Erick Erickson wrote: > > I *think* what you're looking for is Document.getFields(String field), > which returns

Re: Multiple values in field

2008-10-24 Thread Erick Erickson
I *think* what you're looking for is Document.getFields(String field), which returns a list corresponding to every Document.add() you did originally. Alternatively, you could always index a companion field that had the count of times you called Document.add() on a particular field. Best Erick