You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by Ilya Kasnacheev <il...@gmail.com> on 2005/10/03 15:40:31 UTC

How to get real Explanation instead of crippled HTML version?

IndexSearcher.java:

  public String getExplanation(Query query, Hit hit) throws IOException {
    return luceneSearcher.explain(QueryFilters.filter(query),
                                  hit.getIndexDocNo()).toHtml();
  }

So I only get HTMLised version, which is useless if I need only page
rating (top Explanation.getValue()). How would I get page rating (i.e.
number from 0 to 1 showing how relevant Hit was to Query) from nutch?
Or I'll have to hack nutch class to make luceneSearcher public, in
order to do such basic task? Why did you do toHtml() mandatory at all?
Explanation as is is much more useful.

P.S. Looks like you've tried to hide Lucene from view. Why that?

Re: How to get real Explanation instead of crippled HTML version?

Posted by Ilya Kasnacheev <il...@gmail.com>.
>In recent versions of Nutch the score
>can be retrieved from a hit with ((FloatWritable)hit.getSortValue()).get().

That works fine, thanx.


On 10/3/05, Doug Cutting <cu...@nutch.org> wrote:
> Ilya Kasnacheev wrote:
> > So I only get HTMLised version, which is useless if I need only page
> > rating (top Explanation.getValue()). How would I get page rating (i.e.
> > number from 0 to 1 showing how relevant Hit was to Query) from nutch?
>
> Explanations are not a good way to get this, as, for each explanation,
> the query must be re-executed.  In recent versions of Nutch the score
> can be retrieved from a hit with ((FloatWritable)hit.getSortValue()).get().
>
> Doug
>

Re: How to get real Explanation instead of crippled HTML version?

Posted by Doug Cutting <cu...@nutch.org>.
Ilya Kasnacheev wrote:
> So I only get HTMLised version, which is useless if I need only page
> rating (top Explanation.getValue()). How would I get page rating (i.e.
> number from 0 to 1 showing how relevant Hit was to Query) from nutch?

Explanations are not a good way to get this, as, for each explanation, 
the query must be re-executed.  In recent versions of Nutch the score 
can be retrieved from a hit with ((FloatWritable)hit.getSortValue()).get().

Doug