lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anshum <>
Subject Re: Could one filed include more than one value?
Date Tue, 10 Nov 2009 08:55:51 GMT
If you are talking about multi valued fields, the answer is yes.
You may create multiple field objects with the same name and add to the same
It would lead to adding the values to the same field name for the document.

Anshum Gupta
Naukri Labs!

The facts expressed here belong to everybody, the opinions to me. The
distinction is yours to draw............

On Tue, Nov 10, 2009 at 2:14 PM, Wenhao Xu <> wrote:

> Hi, guys,
>     I have such a problem:
>     I have lots of files. In these files, two of them are related to each
> other and should be deemed as a whole (There is a map file to map them
> together). So they are somewhat like a set of pairs of files: <f11, f12>,
> <f21, f22> , <f31, f32> ... . For a keyword search, the result should also
> be like <fi1, fi2>,....  Their score should be computed together.
>    As far as I know, I could use "doc.add(new Field("field1", new
> FileReader(f11)));", and "doc.add(new Field("field2", new
> FileReader(f12)))"
> for each file respectively.  But in this way, when searching, these two
> fields (field1 and field2) can not be searched together in a single search.
> As I said, these two files should be deemed as a whole and returned
> together. So I am wondering, could I map one filed to more than one value,
>    somewhat like doc.add(new Field("field", new FileReader(f11), new
> FileReader(f12));
>   Is there some way to do this? Or could you give me some suggestions how
> to solve this problem?
> Thanks,
> W.
> --
> ~_~

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message