Chris Hostetter wrote:
Alas ... tf() doesn't take in a field name, to do this, you'd have to
override the Similarity each time your construct a query object,
something like this i believe...

   Query q = new TermQuery(t) {
      public Similarity getSimilarity(Searcher s) {
         return new SimilarityDelegator
            (TermQuery.this.super.getSimilarity(s)) {
               public float tf(freq) {
                 ...
               }
            }
         }
      }
   }

...but good lord if that isn't a pain.

There's no reason you have to copy this everywhere. You could use a regular, non-anonymous subclass of TermQuery and use that everywhere, no? QueryParser should probably have a getTermQuery() method that can be overridden to support this kind of thing...

Doug

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to