lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ype Kingma <>
Subject Re: Adding multiple paths to a document
Date Tue, 05 Mar 2002 18:32:42 GMT

>I am looking at using lucene to index a large set of documents.  In
>order to be able to search a subset of documents, I've added a
>"path"-field to each document (indexed, not stored, not tokenized).
>Using a prefix-query seems to work fine.
>My problem: Our documents can have several different paths pointing to
>the same document, so I would like to add several paths to each
>document, and be able to find the document using different
>So my question: Is this accomplished simply by adding several fields to
>the document by the same name ?
>	  doc.add(new Field("path",
>	  doc.add(new Field("path",
>This seems to work, but I would like to know if it is the right way.

That's one good way. Adding to a field is possible before passing the
document to an indexwriter. There is an implicit term border between
the add()'s.
Using a single add() with a "path1 path2" field will have the same effect
when the field is tokenized.


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

View raw message