I'm not clear what exactly you are asking. With your examples: Document 1: little boy is running Document 2:boy is little
a phrase query for "little boy" will match the first and not the second. Is that what you want? a phrase query for "litter boy" won't match either, but a general query might match on boy depending on how you set your must/should qualifiers. So maybe you should have a 2 phase approach: do a phrase query and stop if you get hits or do a general non-phrase query if you don't. Alternatively issue both at the same time but with the phrase query boosted. -- Ian. On Mon, Mar 22, 2010 at 2:13 PM, luocanrao <luocan19826...@sohu.com> wrote: > I don't think the current phrasequery can meet my requirement. > > Can someone help me implement such a phrasequery? > > > > Exact match document add some score > > All other match document add 0 score.(no matter how big slop is) > > > > For example: > > Document 1: little boy is running > > Document 2:boy is little > > > > I query "little boy" > > Document 1 add score 100(Exact match) > > Document 2 add score 0( not Exact match) > > But the two document can match the query. > > user that search "litter boy" should see both the Document, > > but the Document 1 is on the top!! > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org