FileDocCategorySizeDatePackage
TermQueryBuilder.javaAPI DocApache Lucene 1.91049Mon Feb 27 11:12:20 GMT 2006org.apache.lucene.xmlparser.builders

TermQueryBuilder

public class TermQueryBuilder extends Object implements org.apache.lucene.xmlparser.QueryBuilder
author
maharwood

Fields Summary
Constructors Summary
Methods Summary
public org.apache.lucene.search.QuerygetQuery(org.w3c.dom.Element e)

		String field=DOMUtils.getAttributeWithInheritance(e,"fieldName");
		String value=DOMUtils.getText(e);
		if((field==null)||(field.length()==0))
		{
			throw new ParserException("TermQuery element missing fieldName attribute");
		}
		if((value==null)||(value.length()==0))
		{
			throw new ParserException("TermQuery element missing child text property ");
		}
		TermQuery tq = new TermQuery(new Term(field,value));
		
		tq.setBoost(DOMUtils.getAttribute(e,"boost",1.0f));
		return tq;