I would like to store a set of keywords in a single field of a document.

for example I have now three keywords: "One", "Two" and "Three"
and I am going to add them into a document.

At first, is this code correct?
/****************************************************************/
String[] keyword = new String[]{"One", "Two", "Three"};
for (int i = 0; i < keyword.length; i++) {
   Field f = new Field("field_name",
                            keyword[i],
                            Field.Store.NO,
                            Field.Index.UN_TOKENIZED,
                            TermVector.YES);
   doc.add(f);
}
indexWriter.addDocument(doc);
/***************************************************************/

when searching, We can set Boost for a query term.

the question is...
Can I set Boost for every keyword/term while indexing?

from the example above. I may set those keywords. i.e. "One", "Two" and
"Three", with different "Weight/Boost/Relavance..." while indexing.
and the same "term" may have different "Weight/Boost/Relavance..." in
different document.

can I do this?

thanks. :-)

Reply via email to