On Aug 23, 2006, at 11:36 AM, Suba Suresh wrote:
In "Lucene In Action" book it says it is better practice to combine
two fields into one field and index it than use the
MultiFieldQueryParser. Do I initially index both the fields and
then index them again together? When I index them together do I
index the fieldnames or values? Can someone give me an example of
how to do it?
What I do is simply index all the fields individually that need to be
searchable or just stored, but also index a general-purpose
"contents" field with all of that same text.
You can add multiple fields of the same name to a document, making it
easy to just keep appending to a "contents" field for a document.
You can see how this is done in the Lucene in Action code in the
TestDataDocumentHandler.java - however I took a cruder approach and
appended the fields together with a space in between them rather than
using the multiple valued field approach. Either technique will work
just fine.
Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]