On Dec 10, 2009, at 6:35 AM, Raghuveer Kancherla wrote: > 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?
I don't think that there is a conversion method. You will need to do this on your own. > > Also, are there any performance considerations while using a > PayloadNearQuery instead of a PhraseQuery? Yes, I would suspect PNQ to be slower, but likely not that much slower. That being said, I haven't benchmarked it. Then again, PNQ does stuff that PQ doesn't, so it's an apples and oranges debate. > > 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 >> >> >> >> -------------------------- Grant Ingersoll http://www.lucidimagination.com/ Search the Lucene ecosystem (Lucene/Solr/Nutch/Mahout/Tika/Droids) using Solr/Lucene: http://www.lucidimagination.com/search