Update of /cvsroot/nutch/nutch/src/java/net/nutch/searcher
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9211/src/java/net/nutch/searcher

Modified Files:
        IndexSearcher.java QueryTranslator.java 
Log Message:
Some scoring tweaks.

Index: QueryTranslator.java
===================================================================
RCS file: /cvsroot/nutch/nutch/src/java/net/nutch/searcher/QueryTranslator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** QueryTranslator.java        20 May 2003 20:57:17 -0000      1.2
--- QueryTranslator.java        6 Apr 2004 02:54:06 -0000       1.3
***************
*** 106,110 ****
              sloppyPhrase.add(luceneTerm(field, clause.getTerm()));
              sloppyTerms++;
!             requirements.add(new TermQuery(luceneTerm(field,clause.getTerm())),
                               true, false);
            } else {
--- 106,110 ----
              sloppyPhrase.add(luceneTerm(field, clause.getTerm()));
              sloppyTerms++;
!             requirements.add(termQuery(field, clause.getTerm(), boost),
                               true, false);
            } else {
***************
*** 130,133 ****
--- 130,139 ----
      }
  
+     private static TermQuery termQuery(String field, Term term, float boost) {
+       TermQuery result = new TermQuery(luceneTerm(field, term));
+       result.setBoost(boost);
+       return result;
+     }
+ 
      /** Utility to construct a Lucene exact phrase query for a Nutch phrase. */
      private static PhraseQuery exactPhrase(Phrase nutchPhrase,

Index: IndexSearcher.java
===================================================================
RCS file: /cvsroot/nutch/nutch/src/java/net/nutch/searcher/IndexSearcher.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** IndexSearcher.java  5 Apr 2004 16:50:48 -0000       1.6
--- IndexSearcher.java  6 Apr 2004 02:54:06 -0000       1.7
***************
*** 49,52 ****
--- 49,53 ----
      }
      this.luceneSearcher = new MultiSearcher(searchables);
+     this.luceneSearcher.setSimilarity(sim);
    }
  
***************
*** 56,59 ****
--- 57,61 ----
      throws IOException {
      this.luceneSearcher = new org.apache.lucene.search.IndexSearcher(index);
+     this.luceneSearcher.setSimilarity(new NutchSimilarity());
    }
  



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nutch-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nutch-cvs

Reply via email to