Skip to content

Commit

Permalink
[elastic#9053] introduce index option named 'index.percolator.map_unm…
Browse files Browse the repository at this point in the history
…apped_field_as_string
  • Loading branch information
sweetest committed Jan 10, 2015
1 parent 8bcfb88 commit b5a80db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Expand Up @@ -22,18 +22,15 @@
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.action.percolate.PercolateResponse;
import org.elasticsearch.action.percolate.PercolateSourceBuilder;
import org.elasticsearch.common.settings.ImmutableSettings;
import org.elasticsearch.index.percolator.PercolatorException;
import org.elasticsearch.index.query.QueryParsingException;
import org.elasticsearch.test.ElasticsearchIntegrationTest;
import org.junit.Test;

import static org.elasticsearch.action.percolate.PercolateSourceBuilder.docBuilder;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertMatchCount;
import static org.hamcrest.Matchers.arrayWithSize;
import static org.hamcrest.Matchers.instanceOf;

/**
Expand Down Expand Up @@ -73,4 +70,5 @@ public void testPercolatorUpgrading() throws Exception {
assertThat(e.getRootCause(), instanceOf(QueryParsingException.class));
}
}

}
Expand Up @@ -2039,7 +2039,7 @@ public void testMapUnmappedFieldAsString() throws IOException{
assertAcked(prepareCreate("test")
.setSettings(settings));
client().prepareIndex("test", PercolatorService.TYPE_NAME)
.setSource(jsonBuilder().startObject().field("query", queryStringQuery("VALUE")).endObject()).get();
.setSource(jsonBuilder().startObject().field("query", matchQuery("field1", "value")).endObject()).get();
logger.info("--> Percolate doc with field1=value");
PercolateResponse response1 = client().preparePercolate()
.setIndices("test").setDocumentType("type")
Expand Down

0 comments on commit b5a80db

Please sign in to comment.