String field=DOMUtils.getAttributeWithInheritanceOrFail(e,"fieldName"); String value=DOMUtils.getNonBlankTextOrFail(e); TermQuery tq = new TermQuery(new Term(field,value)); tq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f)); return tq;