// Path: src/main/java/crate/elasticsearch/action/searchinto/parser/SearchIntoParser.java
// public class SearchIntoParser extends AbstractSearchIntoParser implements ISearchIntoParser {
// 
//     private final ImmutableMap<String, SearchParseElement> elementParsers;
// 
//     @Inject
//     public SearchIntoParser(QueryPhase queryPhase, FetchPhase fetchPhase) {
//         Map<String, SearchParseElement> elementParsers = new HashMap<String,
//                 SearchParseElement>();
//         elementParsers.putAll(queryPhase.parseElements());
//         elementParsers.put("fields", new FieldsParseElement());
//         elementParsers.put("targetNodes", new TargetNodesParseElement());
//         elementParsers.put("explain", new ExplainParseElement());
//         this.elementParsers = ImmutableMap.copyOf(elementParsers);
//     }
// 
//     @Override
//     protected void validate(SearchIntoContext context) {
//         if (!context.hasFieldNames()) {
//             throw new SearchParseException(context, "No fields defined");
//         }
// 
//         for (String field : context.fieldNames()) {
//             FieldMapper<?> mapper = context.mapperService().smartNameFieldMapper(
//                     field);
//             if (mapper == null && !field.equals(
//                     "_version") && !field.startsWith(
//                     FieldsParseElement.SCRIPT_FIELD_PREFIX)) {
//                 throw new SearchParseException(context,
//                         "SearchInto field [" + field + "] does not exist in " +
//                                 "the mapping");
//             }
//         }
//         super.validate(context);
//     }
// 
//     @Override
//     protected ImmutableMap<String, SearchParseElement> getElementParsers() {
//         return elementParsers;
//     }
// 
// 
// }


import org.elasticsearch.cache.recycler.CacheRecycler;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.script.ScriptService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import crate.elasticsearch.action.searchinto.parser.SearchIntoParser;
import crate.elasticsearch.searchinto.Writer;
package crate.elasticsearch.action.searchinto;




/**
 *
 */
public class TransportSearchIntoAction extends AbstractTransportSearchIntoAction {

    @Inject
    public TransportSearchIntoAction(Settings settings,
            ThreadPool threadPool, ClusterService clusterService,
            TransportService transportService, CacheRecycler cacheRecycler,
            IndicesService indicesService, ScriptService scriptService,
// Path: src/main/java/crate/elasticsearch/action/searchinto/parser/SearchIntoParser.java
// public class SearchIntoParser extends AbstractSearchIntoParser implements ISearchIntoParser {
// 
//     private final ImmutableMap<String, SearchParseElement> elementParsers;
// 
//     @Inject
//     public SearchIntoParser(QueryPhase queryPhase, FetchPhase fetchPhase) {
//         Map<String, SearchParseElement> elementParsers = new HashMap<String,
//                 SearchParseElement>();
//         elementParsers.putAll(queryPhase.parseElements());
//         elementParsers.put("fields", new FieldsParseElement());
//         elementParsers.put("targetNodes", new TargetNodesParseElement());
//         elementParsers.put("explain", new ExplainParseElement());
//         this.elementParsers = ImmutableMap.copyOf(elementParsers);
//     }
// 
//     @Override
//     protected void validate(SearchIntoContext context) {
//         if (!context.hasFieldNames()) {
//             throw new SearchParseException(context, "No fields defined");
//         }
// 
//         for (String field : context.fieldNames()) {
//             FieldMapper<?> mapper = context.mapperService().smartNameFieldMapper(
//                     field);
//             if (mapper == null && !field.equals(
//                     "_version") && !field.startsWith(
//                     FieldsParseElement.SCRIPT_FIELD_PREFIX)) {
//                 throw new SearchParseException(context,
//                         "SearchInto field [" + field + "] does not exist in " +
//                                 "the mapping");
//             }
//         }
//         super.validate(context);
//     }
// 
//     @Override
//     protected ImmutableMap<String, SearchParseElement> getElementParsers() {
//         return elementParsers;
//     }
// 
// 
// }


// Path: src/main/java/crate/elasticsearch/action/searchinto/TransportSearchIntoAction.java
import org.elasticsearch.cache.recycler.CacheRecycler;
import org.elasticsearch.cluster.ClusterService;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.indices.IndicesService;
import org.elasticsearch.script.ScriptService;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.transport.TransportService;
import crate.elasticsearch.action.searchinto.parser.SearchIntoParser;
import crate.elasticsearch.searchinto.Writer;

package crate.elasticsearch.action.searchinto;




/**
 *
 */
public class TransportSearchIntoAction extends AbstractTransportSearchIntoAction {

    @Inject
    public TransportSearchIntoAction(Settings settings,
            ThreadPool threadPool, ClusterService clusterService,
            TransportService transportService, CacheRecycler cacheRecycler,
            IndicesService indicesService, ScriptService scriptService,
            SearchIntoParser parser, Writer writer) {