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 Paul Libbrecht <pa...@activemath.org> on 2010/01/29 22:38:56 UTC

"one of the terms"

Hello luceners,

In our project, we are building queries from long list of possible  
terms (expanded through ontology deduction). I would like, however,  
that the rank is unaffected by the number of matches: one or thirty  
occurrences of one of the many words should give the same score.

Did someone make such a query already?
Should I "just craft the Similarity"? (I'd rather avoid it if possible)

thanks in advance

paul

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


Re: "one of the terms"

Posted by Jake Mannix <ja...@gmail.com>.
coord won't help him, I don't think.

Doesn't he just want a DisjunctionMaxQuery instead of BooleanQuery?

  -jake

On Fri, Jan 29, 2010 at 9:28 PM, Otis Gospodnetic <
otis_gospodnetic@yahoo.com> wrote:

> Paul,
>
> Custom Similarity perhaps, oui.  Not 100% sure, maybe have this always
> return 1.0f.
>
>
>  /** Computes a score factor based on the fraction of all query terms that
> a
>   * document contains.  This value is multiplied into scores.
>   *
>   * The presence of a large portion of the query terms indicates a better
>   * match with the query, so implementations of this method usually return
>   * larger values when the ratio between these parameters is large and
> smaller
>   * values when the ratio between them is small.
>   *
>   * @param overlap the number of query terms matched in the document
>   * @param maxOverlap the total number of terms in the query
>   * @return a score factor based on term overlap with the query
>   */
>  public abstract float coord(int overlap, int maxOverlap);
>
> Otis
> ----
> Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
> Hadoop ecosystem search :: http://search-hadoop.com/
>
>
>
> ----- Original Message ----
> > From: Paul Libbrecht <pa...@activemath.org>
> > To: java-user@lucene.apache.org
> > Sent: Fri, January 29, 2010 4:38:56 PM
> > Subject: "one of the terms"
> >
> >
> > Hello luceners,
> >
> > In our project, we are building queries from long list of possible terms
> > (expanded through ontology deduction). I would like, however, that the
> rank is
> > unaffected by the number of matches: one or thirty occurrences of one of
> the
> > many words should give the same score.
> >
> > Did someone make such a query already?
> > Should I "just craft the Similarity"? (I'd rather avoid it if possible)
> >
> > thanks in advance
> >
> > paul
> >
> > ---------------------------------------------------------------------
> > 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: "one of the terms"

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Paul,

Custom Similarity perhaps, oui.  Not 100% sure, maybe have this always return 1.0f.


  /** Computes a score factor based on the fraction of all query terms that a
   * document contains.  This value is multiplied into scores.
   *
   * The presence of a large portion of the query terms indicates a better
   * match with the query, so implementations of this method usually return
   * larger values when the ratio between these parameters is large and smaller
   * values when the ratio between them is small.
   *
   * @param overlap the number of query terms matched in the document
   * @param maxOverlap the total number of terms in the query
   * @return a score factor based on term overlap with the query
   */
  public abstract float coord(int overlap, int maxOverlap);

Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Hadoop ecosystem search :: http://search-hadoop.com/



----- Original Message ----
> From: Paul Libbrecht <pa...@activemath.org>
> To: java-user@lucene.apache.org
> Sent: Fri, January 29, 2010 4:38:56 PM
> Subject: "one of the terms"
> 
> 
> Hello luceners,
> 
> In our project, we are building queries from long list of possible terms 
> (expanded through ontology deduction). I would like, however, that the rank is 
> unaffected by the number of matches: one or thirty occurrences of one of the 
> many words should give the same score.
> 
> Did someone make such a query already?
> Should I "just craft the Similarity"? (I'd rather avoid it if possible)
> 
> thanks in advance
> 
> paul
> 
> ---------------------------------------------------------------------
> 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