Re: highlight only one field

2005-11-11 Thread Ernesto De Santis
Yes, this work. . String strQuery = query.toString(); WeightedTerm[] weightedTerm = QueryTermExtractor.getTerms(query); ArrayList bodyQueryTerms = new ArrayList(); for (int i = 0; i < weightedTerm.length; i++) { String term = weightedTerm[i].getTe

Re: highlight only one field

2005-11-11 Thread mark harwood
>>> This don't work, because Ah, crap. You'll have to drop down another level. Every line of code in QueryTermsExtractor that calls terms.add(new WeightedTerm(..)) would be the place to test the field name then. For now you could copy QueryTermsExtractor and put an "if" around these lines whi

Re: highlight only one field

2005-11-11 Thread Ernesto De Santis
Hi Mark This don't work, because WeightedTerm[] weightedTerm = QueryTermExtractor.getTerms(query); return query terms values , not the fields names. example: for "body:mark title:highlight" return [mark, highlight], I can't compare this values with "body" field. Ernesto. mark harwood

Re: highlight only one field

2005-11-11 Thread mark harwood
Ah. You're right. Looks like the current highlighter api doesn't offer you that degree of control. The way to fix it is probably to tweak the list of WeightedTerms you give the highlighter: [psuedo code follows...] terms=QueryTermExtractor.getTerms(query); bodyQueryTerms=new ArrayList(); for all