lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "S.L. (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (LUCENE-3440) FastVectorHighlighter: IDF-weighted terms for ordered fragments
Date Thu, 22 Sep 2011 11:25:26 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-3440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13112481#comment-13112481
] 

S.L. edited comment on LUCENE-3440 at 9/22/11 11:24 AM:
--------------------------------------------------------

No, can't verify that. It's my first patch, maybe I did something wrong. The patch is built
from branch_3x with the subversion-plug-in for Eclipse.  I took the todays branch_3x (Import
-> SVN -> Checkout projects ...) a few minutes ago and patched it (Team -> Apply
patch). No problem with my setup. 

Another approach:

Assuming a user searches for a single word, he rather would like to see fragments with a culmination
of that word:

{code:title=Bar.java|borderStyle=solid}

for( WeightedPhraseInfo phraseInfo : phraseInfoList ){
        SubInfo subInfo = new SubInfo( phraseInfo.text, phraseInfo.termsOffsets, phraseInfo.seqnum
);
        subInfos.add( subInfo );
        
        Iterator it = phraseInfo.termInfos.iterator();
        TermInfo ti;
        
        while ( it.hasNext() ) {
          ti = ( TermInfo ) it.next();
          distinctTerms.add( ti.text );
          totalBoost += Math.pow(ti.weight, ti.weight) * phraseInfo.boost;
        }
      }
}
totalBoost *= distinctTerms.size();
{code}




      was (Author: mdz-munich):
    No, can't verify that. It's my first patch, maybe I did something wrong. The patch is
built from branch_3x with the subversion-plug-in for Eclipse.  I took the todays branch_3x
(Import -> SVN -> Checkout projects ...) a few minutes ago and patched it (Team ->
Apply patch). No problem with my setup. 

Another approach:

Assuming a user searches for a single word, he rather would like to see fragments with a culmination
of that word:

{code:title=Bar.java|borderStyle=solid}
      for( WeightedPhraseInfo phraseInfo : phraseInfoList ){
        SubInfo subInfo = new SubInfo( phraseInfo.text, phraseInfo.termsOffsets, phraseInfo.seqnum
);
        subInfos.add( subInfo );
        
        Iterator it = phraseInfo.termInfos.iterator();
        TermInfo ti;
        
        while ( it.hasNext() ) {
          ti = ( TermInfo ) it.next();
          distinctTerms.add( ti.text );
          totalBoost += Math.pow(ti.weight, ti.weight) * phraseInfo.boost;
        }
      }
      
      totalBoost *= distinctTerms.size();
{code}



  
> FastVectorHighlighter: IDF-weighted terms for ordered fragments 
> ----------------------------------------------------------------
>
>                 Key: LUCENE-3440
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3440
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: modules/highlighter
>    Affects Versions: 3.5
>            Reporter: S.L.
>            Priority: Minor
>              Labels: patch
>             Fix For: 3.5
>
>         Attachments: LUCENE-3440-1.patch
>
>
> The FastVectorHighlighter uses for every term found in a fragment an equal weight, which
causes a higher ranking for fragments with a high number of words or, in the worst case, a
high number of very common words than fragments that contains *all* of the terms used in the
original query. 
> This patch provides ordered fragments with IDF-weighted terms: 
> total weight = total weight + IDF for unique term per fragment * boost of query; 
> The ranking-formula should be the same, or at least similar, to that one used in org.apache.lucene.search.highlight.QueryTermScorer.
> The patch is simple, but it works for us. 
> Some ideas:
> - A better approach would be moving the whole fragments-scoring into a separate class.
> - Switch scoring via parameter 
> - Exact phrases should be given a even better score, regardless if a phrase-query was
executed or not
> - edismax/dismax-parameters pf, ps and pf^boost should be observed and corresponding
fragments should be ranked higher 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message