I was looking through some lucene source codes and found the following class org.apache.lucene.search.payloads.PayloadSpanUtil
There is a function named queryToSpanQuery in this class. Is this the preferred way to convert a PhraseQuery to PayloadNearQuery? Also, are there any performance considerations while using a PayloadNearQuery instead of a PhraseQuery? Thanks, Raghu On Thu, Dec 10, 2009 at 4:40 PM, AHMET ARSLAN <iori...@yahoo.com> wrote: > > Hi, > > I am looking for a way to use payloads in my search > > application. Indexing > > data with payloads into Solr is pretty straightforward. > > However using the > > payloads during search time is a bit confusing. Can anyone > > point me in the > > right direction to enable payloads on a *PhraseQuery*. I > > looked at the > > following resources and got payload on a TermQuery > > working. > > > > 1. > > > http://www.lucidimagination.com/blog/2009/08/05/getting-started-with-payloads/ > > 2. > http://www.mail-archive.com/solr-user@lucene.apache.org/msg24863.html > > 3. There is also a jira issue (SOLR-1485) > > that gives a patch for using > > Payload. > > 4. Lucene-In-Action > > > > I am guessing that I should return a payload version of > > PhraseQuery in > > QueryParser's (package > > org.apache.lucene.queryParser.queryParser.java) > > newPhraseQuery function. If yes, what type should this > > query be? > > Yes. PayloadNearQuery [1] > > [1] > http://lucene.apache.org/java/3_0_0/api/core/org/apache/lucene/search/payloads/PayloadNearQuery.html > > > >