lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Miller <>
Subject Re: How to combine multiple fields to a single field for indexing
Date Mon, 04 Sep 2006 15:20:19 GMT
How do you set the position increment gap between each addition to the 
same field name. Should you set it as high as possible to prevent 
proximity queries from crossing it? I have been looking for the code to 
find out how to put a gap between each same name field addition, but I 
have been unable to find what I am looking for. Also, when using a 
nearspan, things blow up if you look for something within 
Integer.maximum--sic :) -- Will this be the same case for setting the 
positional gap and if so is there a good max to use to keep a query from 
ever crossing it?



Erik Hatcher wrote:
> 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 
> - 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:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message