lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Spencer <>
Subject Re: Quick Question On Adding Fields
Date Thu, 20 Mar 2003 13:53:09 GMT
Rob Outar wrote:

>What happens if I add the same name/value pair to a Lucene Document?  Does
>it override it?  Does it append it so you have duplicates?
I believe it 'appends' in the sense that if you add 2 fields with the same
name then the Document has the union of the content of both fields
added, and then you can search on anything in either or both of the field
values you added.

One use case is if you're indexing html and you want a field for the 
title, a field
for the body, and a easy way for users to refer to both the field and 
the body
in a query.

So when you add a Field for the title named "title",
you also add one with a name like "contents", and then
you add a field for the body named "body", and then you
pass the same data and add another field named "contents".
Then, voilla, a search on contents:foo returns matches against
the title and the body.

>Let me know,
>To unsubscribe, e-mail:
>For additional commands, e-mail:

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

View raw message