lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Griffin" <>
Subject Explanation
Date Fri, 23 Nov 2007 23:22:44 GMT
Is there a problem with the term frequency count (tf) and the
IndexSearcher.explain method? I'm searching the following string (fieldname
is description) for the term 'salesman' and receive the accompanying
explanation from IndexSearcher.explain(.). I've highlighted salesman.


score => 0.3362463


any agent who fails to meet his quota of sales "leads" (i.e., potential
buyers) will lose his job. This intense ultimatum is a boon for the office
superstar (Pacino), but a once-successful salesman (Lemmon) now finds
himself clinging nervously to faded glory. Political and personal rivalries
erupt under pressure when the other agents (Alan Arkin, Ed Harris) suspect
the office manager (Kevin Spacey) of foul play. This cauldron of anxiety,
tension, and sheer desperation provides fertile soil 



0.0 = (NON-MATCH) fieldWeight(description:salesman in 4), product of:

  0.0 = tf(termFreq(description:salesman)=0)

  5.379941 = idf(docFreq=5)

  0.15625 = fieldNorm(field=description, doc=4)


In other queries I also get the same termFreq response of 0.


Here's my code:

        IndexSearcher indexSearcher =

                new IndexSearcher(".");

        TermQuery query = new TermQuery(new Term("description",


        Hits hits =;


        int hitCount = hits.length();

        int counter = 0;

        for (Iterator iter = hits.iterator(); iter.hasNext();)


            Hit hit = (Hit);

            System.out.println("score => " + hit.getScore());

            Document doc = hit.getDocument();






Thanks in advance.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message