Re: Indexing with weights

2011-01-24 Thread Chris Schilling
Well, maybe this trick is better? while(parseFile) { String keyword = ...; String score = ...; doc.add(new Field("keywords", keyword, Field.Store.NO, Field.Index.ANALYZED)); doc.add(new NumericField(keyword).setAsDouble(score)); } Then, I guess I can sort based on

Re: Indexing with weights

2011-01-24 Thread Chris Schilling
Thanks Erick, So something like: while(parseFile) { String keyword = ...; String score = ...; doc.add(new Field("keywords", keyword, Field.Store.NO, Field.Index.ANALYZED)); doc.add(new Field("scores", score, Field.Store.YES, Field.Index.NOT_ANALYZED)); } How wou

Re: Indexing with weights

2011-01-24 Thread Erick Erickson
I think all you need to do is index the keywords in one field and weights in another. Then just search on keywords and sort on weight. Note: the field you sort on should NOT be tokenized. Best Erick On Mon, Jan 24, 2011 at 4:02 PM, Chris Schilling wrote: > Hello, > > I have a bunch of text doc