boolean isRanked = leaf.isRanked(); String label = leaf.getLabel(); int weight = leaf.getWeight();
/** * Returns an integer that contains all feature flags for this item. This must be kept in sync with the flags * defined in searchlib/parsequery/parse.h. * * @return The feature flags. */ private byte getFlagsFeature() { byte FLAGS_NORANK = 0x01; byte FLAGS_SPECIALTOKEN = 0x02; byte FLAGS_NOPOSITIONDATA = 0x04; byte FLAGS_ISFILTER = 0x08; byte ret = 0; if (!isRanked()) { ret |= FLAGS_NORANK; } if (isFromSpecialToken()) { ret |= FLAGS_SPECIALTOKEN; } if (!usePositionData()) { ret |= FLAGS_NOPOSITIONDATA; } if (isFilter()) { ret |= FLAGS_ISFILTER; } return ret; }
private static void removeOtherNonrankedChildren(CompositeItem parent, int indexOfChildToKeep) { Item childToKeep = parent.getItem(indexOfChildToKeep); for (int i = parent.getItemCount(); --i >= 0; ) { Item child = parent.getItem(i); if ( child != childToKeep && ! parent.getItem(i).isRanked()) parent.removeItem(i); } }
private void copyAttributes(Item blockAsItem, Item replacement) { copyWeight(blockAsItem, replacement); replacement.setCreator(blockAsItem.getCreator()); replacement.setRanked(blockAsItem.isRanked()); replacement.setPositionData(blockAsItem.usePositionData()); }