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 <4azfri...@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-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org