lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Grim Hegland Iversen" <g...@api.no>
Subject Adding multiple paths to a document
Date Tue, 05 Mar 2002 10:40:44 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
prefix-queries.

So my question: Is this accomplished simply by adding several fields to
the document by the same name ?

	  doc.add(new Field("path",
"/test/path1/misc"),false,true,false));
	  doc.add(new Field("path",
"/test/path2/misc"),false,true,false));

This seems to work, but I would like to know if it is the right way.

--
To unsubscribe, e-mail:   <mailto:lucene-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:lucene-user-help@jakarta.apache.org>


Mime
View raw message