You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by "Arnone, Anthony" <aa...@rightnow.com> on 2007/12/04 22:42:02 UTC

span queries and proximity boosting

Hello all,

 

I’ve been looking into using the nice power of the SpanNearQuery instead of PhraseQuery, mostly because of the simplification of the slop factors. However, I’m wondering if the SpanNearQueries will boost the result based on the term proximity, just like PhraseQuery does. Does anyone have any experience with doing this?

 

Thanks,

Anthony


Re: span queries and proximity boosting

Posted by Mark Miller <ma...@gmail.com>.
Doh! Even after careful scanning I missed that. Of course your right 
though....scores with:
 
/** Computes the amount of a sloppy phrase match, based on an edit distance.
   * This value is summed for each sloppy phrase match in a document to form
   * the frequency that is passed to {@link #tf(float)}.
   *
   * <p>A phrase match with a small edit distance to a document passage more
   * closely matches the document, so implementations of this method usually
   * return larger values when the edit distance is small and smaller values
   * when it is large.
   *
   * @see PhraseQuery#setSlop(int)
   * @param distance the edit distance of this sloppy phrase match
   * @return the frequency increment for this match
   */
  public abstract float sloppyFreq(int distance);

Chris Hostetter wrote:
> : A quick look at the code would say no, unless I am missing something. Neither
> : the weight or span scorer seem to take distance into account.
>
> uh, i think you're wrong ... SpanScorer takes the distance between the 
> "end" of the spans and the "start" of the spans into account just like a 
> PraseQuery considers the positions of the terms (it's just a bit more 
> complicated with Spans because of the nesting that's possible)
>
> (look for "matchLength" in SpamScorer)
>
>
>
>
> -Hoss
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
>   

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


Re: span queries and proximity boosting

Posted by Chris Hostetter <ho...@fucit.org>.
: A quick look at the code would say no, unless I am missing something. Neither
: the weight or span scorer seem to take distance into account.

uh, i think you're wrong ... SpanScorer takes the distance between the 
"end" of the spans and the "start" of the spans into account just like a 
PraseQuery considers the positions of the terms (it's just a bit more 
complicated with Spans because of the nesting that's possible)

(look for "matchLength" in SpamScorer)




-Hoss


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


Re: span queries and proximity boosting

Posted by Mark Miller <ma...@gmail.com>.
A quick look at the code would say no, unless I am missing something. 
Neither the weight or span scorer seem to take distance into account.

Arnone, Anthony wrote:
> Hello all,
>
>  
>
> I’ve been looking into using the nice power of the SpanNearQuery instead of PhraseQuery, mostly because of the simplification of the slop factors. However, I’m wondering if the SpanNearQueries will boost the result based on the term proximity, just like PhraseQuery does. Does anyone have any experience with doing this?
>
>  
>
> Thanks,
>
> Anthony
>
>   

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