List<Field> retValue = new ArrayList<Field>(2);
if (this.fieldName == null)
throw new GdataIndexerException("Required field 'name' is null -- "
+ this.config);
if (this.content == null)
throw new GdataIndexerException(
"Required field 'content' is null -- " + this.config);
Field categoryTerm = new Field(this.fieldName, this.content,
this.store, this.index);
float boost = this.config.getBoost();
if (boost != 1.0f)
categoryTerm.setBoost(boost);
retValue.add(categoryTerm);
/*
* if schema is not set index null value to enable search for categories
* without a schema
*/
if (this.categoryScheme == null || this.categoryScheme.length() == 0) {
this.categoryScheme = CATEGORY_SCHEMA_NULL_VALUE;
}
Field categoryURN = new Field(this.categorySchemeField,
this.categoryScheme, Field.Store.YES, Field.Index.UN_TOKENIZED);
retValue.add(categoryURN);
return retValue.toArray(new Field[0]);