lucene4: action package cleanup

This commit is contained in:
Igor Motov 2012-10-30 11:32:17 -04:00 committed by Shay Banon
parent 3269e0c88e
commit fd2cf776d8
2 changed files with 5 additions and 5 deletions

View File

@ -86,7 +86,7 @@ public class TransportExplainAction extends TransportShardSingleOperationAction<
protected ExplainResponse shardOperation(ExplainRequest request, int shardId) throws ElasticSearchException { protected ExplainResponse shardOperation(ExplainRequest request, int shardId) throws ElasticSearchException {
IndexService indexService = indicesService.indexService(request.index()); IndexService indexService = indicesService.indexService(request.index());
IndexShard indexShard = indexService.shardSafe(shardId); IndexShard indexShard = indexService.shardSafe(shardId);
Term uidTerm = UidFieldMapper.TERM_FACTORY.createTerm(Uid.createUid(request.type(), request.id())); Term uidTerm = new Term(UidFieldMapper.NAME, Uid.createUid(request.type(), request.id()));
Engine.GetResult result = indexShard.get(new Engine.Get(false, uidTerm)); Engine.GetResult result = indexShard.get(new Engine.Get(false, uidTerm));
if (!result.exists()) { if (!result.exists()) {
return new ExplainResponse(false); return new ExplainResponse(false);
@ -104,7 +104,7 @@ public class TransportExplainAction extends TransportShardSingleOperationAction<
try { try {
context.parsedQuery(parseQuery(request, indexService)); context.parsedQuery(parseQuery(request, indexService));
context.preProcess(); context.preProcess();
int topLevelDocId = result.docIdAndVersion().docId + result.docIdAndVersion().docStart; int topLevelDocId = result.docIdAndVersion().docId + result.docIdAndVersion().reader.docBase;
Explanation explanation = context.searcher().explain(context.query(), topLevelDocId); Explanation explanation = context.searcher().explain(context.query(), topLevelDocId);
if (request.fields() != null) { if (request.fields() != null) {

View File

@ -19,7 +19,7 @@
package org.elasticsearch.action.mlt; package org.elasticsearch.action.mlt;
import org.apache.lucene.document.Fieldable; import org.apache.lucene.document.Field;
import org.apache.lucene.index.Term; import org.apache.lucene.index.Term;
import org.elasticsearch.ElasticSearchException; import org.elasticsearch.ElasticSearchException;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
@ -263,7 +263,7 @@ public class TransportMoreLikeThisAction extends TransportAction<MoreLikeThisReq
} }
docMapper.parse(SourceToParse.source(getResponse.sourceRef()).type(request.type()).id(request.id()), new DocumentMapper.ParseListenerAdapter() { docMapper.parse(SourceToParse.source(getResponse.sourceRef()).type(request.type()).id(request.id()), new DocumentMapper.ParseListenerAdapter() {
@Override @Override
public boolean beforeFieldAdded(FieldMapper fieldMapper, Fieldable field, Object parseContext) { public boolean beforeFieldAdded(FieldMapper fieldMapper, Field field, Object parseContext) {
if (fieldMapper instanceof InternalMapper) { if (fieldMapper instanceof InternalMapper) {
return true; return true;
} }
@ -281,7 +281,7 @@ public class TransportMoreLikeThisAction extends TransportAction<MoreLikeThisReq
}); });
} }
private void addMoreLikeThis(MoreLikeThisRequest request, BoolQueryBuilder boolBuilder, FieldMapper fieldMapper, Fieldable field) { private void addMoreLikeThis(MoreLikeThisRequest request, BoolQueryBuilder boolBuilder, FieldMapper fieldMapper, Field field) {
addMoreLikeThis(request, boolBuilder, field.name(), fieldMapper.valueAsString(field)); addMoreLikeThis(request, boolBuilder, field.name(), fieldMapper.valueAsString(field));
} }