String searchString = getSearchString(fieldIdx, client.getServer());
searchString = Utilities.isEmpty(searchString) ? item : searchString;
if (Utilities.isEmpty(searchString)) return updated;
OnlineSearchHelper osh = new OnlineSearchHelper(dco.getModule().getIndex(), SearchTask._ITEM_MODE_SIMPLE);
osh.setServer(client.getServer());
osh.setRegion(client.getRegion());
osh.setMode(client.getSearchMode());
osh.setMaximum(2);
Collection<DcObject> results = osh.query(searchString, dco);
for (DcObject result : results) {
if (matches(result, searchString, fieldIdx)) {
merge(dco, result, osh);
updated = true;
break;
}
}
if (!updated) {
searchString = StringUtils.normalize(searchString);
client.addMessage(DcResources.getText("msgSearchingOnlineFor", searchString));
results.clear();
results.addAll(osh.query(searchString, dco));
for (DcObject result : results) {
if (matches(result, searchString, fieldIdx)) {
merge(dco, result, osh);
updated = true;
break;