FieldScore fScore = new FieldScore(); fScore.insertField(field); int fieldScore = fScore.getFieldScore(); if (fieldScore == 0) return numOfModifiedDocs;
/** loads a mapping of field name -> field id */ protected void load_field_ids() { FieldScore.init(); useFieldInformation = FieldScore.USE_FIELD_INFORMATION; if (! FieldScore.USE_FIELD_INFORMATION || FieldScore.FIELDS_COUNT == 0) return; numFields = FieldScore.FIELDS_COUNT; logger.info("Indexer using " + numFields + " fields"); int i=0; for (String f: FieldScore.FIELD_NAMES) { i++; String[] tagNames = ArrayUtils.parseDelimitedString(f, "|"); for (String tag : tagNames) { fieldNames.put(tag, i); } } }
/** This method must be called by anything which directly extends Indexer. * See: http://benpryor.com/blog/2008/01/02/dont-call-subclass-methods-from-a-superclass-constructor/ */ protected void init() { FieldScore.init(); //init fields before constructing pipeline this.load_field_ids(); //construct pipeline using list specified in terrier.properties //this object should be the last item in the pipeline this.load_indexer_properties(); this.load_pipeline(); //load the docnos of any documents that should force builder boundaries this.load_builder_boundary_documents(); }
FieldScore fScore = new FieldScore(); fScore.insertField(field); int fieldScore = fScore.getFieldScore(); if (fieldScore == 0) return numOfModifiedDocs;