Payloads are added during analysis onto the Token. Have a look in the contrib/analyzers module in 2.3 or the trunk version of Lucene. There are a couple of examples in there that add payloads to tokens (see the payloads package at http://lucene.apache.org/java/2_3_0/api/contrib-analyzers/org/apache/lucene/analysis/payloads/package-summary.html) . You can use the BoostingTermQuery to use the payload as a factor in scoring, or, you might be able to write your own custom Sort, but I haven't thought that all the way through just yet.

Michael B. also has an excellent talk from last year's ApacheCon that covers payloads at http://people.apache.org/~buschmi/apachecon/AdvancedIndexingLuceneAtlanta07.ppt

-Grant

On Feb 6, 2008, at 4:54 AM, Allahbaksh Mohammedali Asadullah wrote:


Hi All,
I want to store information in Payload. How do I write Payload value to Index. How to I sort value depending upon the Payload? I could not find any method in Document class which takes Payload as argument.

Regards,
Allahbaksh





**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

--------------------------
Grant Ingersoll
http://lucene.grantingersoll.com
http://www.lucenebootcamp.com

Lucene Helpful Hints:
http://wiki.apache.org/lucene-java/BasicsOfPerformance
http://wiki.apache.org/lucene-java/LuceneFAQ





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to