SpanFirstQuery is the clean option. Another option is to add a "start token" to each title. Then, search for "startToken oil spill". This will be faster than SpanFirstQuery. But it also requires doing something weird to the field.
Lance On Thu, Jun 17, 2010 at 3:19 PM, Michael McCandless <luc...@mikemccandless.com> wrote: > SpanFirstQuery? > > Mike > > On Thu, Jun 17, 2010 at 3:23 PM, rakesh rakesh <rakeshiit.2...@gmail.com> > wrote: >> Hi, >> >> I have thousands of article titles in lucene index. So for a query "Oil >> spill" I want to return all the article title starts with "Oil spill". I do >> not want those titles which has this phrase but do not start with this. >> >> Can anyone help me. >> >> Thanks in advance >> >> Thanks >> rakesh >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org > For additional commands, e-mail: java-user-h...@lucene.apache.org > > -- Lance Norskog goks...@gmail.com --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org