lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From A Z <4azfri...@gmail.com>
Subject Re: weightage of each word according to precedence in document
Date Sat, 28 Jan 2012 04:44:10 GMT
Hi lan

thanks for your reply.

when i boosting each term while searching like   abcd is boost with boost
factor of 10 and pqrst boost with boost factor of 5.
then also it gives same score for documents

*Query content:abcd^10.0 content:pqrst^5.0*


title ->pqrst uvwx abcd ::: content -> pqrst uvwx abcd::: Score ->0.40883923

title ->abcd pqrst uvwx ::: content -> abcd pqrst uvwx::: Score ->0.40883923

title ->pqrst uvwx lmn ::: content -> pqrst uvwx lmn::: Score ->0.40883923

title ->pqrst uvwx lmn abcd ::: content -> pqrst uvwx lmn abcd::: Score
->0.40883923

title ->pqrst abcd uvwx lmn ::: content -> pqrst abcd uvwx lmn::: Score
->0.40883923
Thanks

On Wed, Jan 25, 2012 at 8:38 PM, Ian Lea <ian.lea@gmail.com> wrote:

> If you want particular search terms to be more important than others
> you can use boosting.  See
> http://lucene.apache.org/java/3_5_0/queryparsersyntax.html#Boosting a
> Term
>
> If you want the order of matched terms to matter, see PhraseQuery or
> SpanQuery.  The latter is more flexible. See
> http://www.lucidimagination.com/blog/2009/07/18/the-spanquery/ for a
> good writeup.
>
> And you can of course use combinations of everything.
>
>
> --
> Ian.
>
>
>
> On Tue, Jan 24, 2012 at 5:08 PM, A Z <4azfriend@gmail.com> wrote:
> > Hi
> >
> >
> >
> > how can we assign custom score for each token/word.
> >
> >
> >
> > For Ex
> >
> > I have document
> >
> >
> >
> > 1    pqrst uvwx abcd
> >
> > 2    abcd pqrst uvwx
> >
> > 3    pqrst uvwx lmn
> >
> > 4    pqrst uvwx lmn abcd
> >
> > 5    pqrst abcd uvwx lmn
> >
> >
> >
> > *Now i m searching data ---> abcd pqrst*
> >
> > So it should give more weightage score to 2nd document then 1st document
> >
> >
> >
> > So i want is
> >
> > *document 1 :---*    *pqrst *has more *weight * then   *uvwx *word and
> *then
> >  abcd *word
> >
> > *document 2* *:---*    *abcd *has more *weight * then   *pqrst*  word
> > and *then  uvwx
> > *word
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

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