/*
 * Copyright (2008-2009) Schibsted ASA
 * This file is part of SESAT.
 *
 *   SESAT is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Affero General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   SESAT is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Affero General Public License for more details.
 *
 *   You should have received a copy of the GNU Affero General Public License
 *   along with SESAT.  If not, see <http://www.gnu.org/licenses/>.
 */
package no.sesat.search.mode.command;

import no.sesat.search.result.BasicResultItem;
import no.sesat.search.result.BasicResultList;
import no.sesat.search.result.ResultItem;
import no.sesat.search.result.ResultList;

import org.apache.log4j.Logger;

/**
 * Endeca module
 * see http://endeca.com
 * 
 * @author bfrutchey
 *
 */
public class EndecaSearchCommand extends AbstractSearchCommand{
	private static final long serialVersionUID = -5302909056820187005L;

	private static final Logger log = Logger.getLogger(EndecaSearchCommand.class);

    public EndecaSearchCommand(Context cxt) {
		super(cxt);
		log.info("EndecaSearchCommand constructed");
	}

	@Override
	public ResultList<ResultItem> execute() {
		BasicResultItem rs = new BasicResultItem();
		rs.addField("title", "This is hello");
		rs.addField("body", "hello world");
		ResultList<ResultItem> rsList = new BasicResultList<ResultItem>();
		rsList.addResult(rs);
		log.info("returning 1 result");
		return rsList;
	}

}
