Skip to content

Commit b877f1b

Browse files
committed
Update to elasticsearch 1.0.0.RC1
Closes elastic#48.
1 parent 2b4f875 commit b877f1b

File tree

9 files changed

+32
-30
lines changed

9 files changed

+32
-30
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ In order to install the plugin, simply run: `bin/plugin -install elasticsearch/e
77

88
| Attachment Mapper Plugin | elasticsearch | Tika | Release date |
99
|-----------------------------|-----------------------|--------|:------------:|
10-
| 1.10.0-SNAPSHOT (master) | 0.90.3 -> 0.90 | 1.4 | |
10+
| 2.0.0.RC1-SNAPSHOT (master) | 1.0.0.RC1 -> master | 1.4 | |
11+
| 1.10.0-SNAPSHOT (1.x) | 0.90.3 -> 0.90 | 1.4 | |
1112
| 1.9.0 | 0.90.3 -> 0.90 | 1.4 | 2013-08-20 |
1213
| 1.8.0 | 0.90.3 -> 0.90 | 1.2 | 2013-08-07 |
1314
| 1.7.0 | 0.90.0 -> 0.90.2 | 1.2 | 2013-02-26 |

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<modelVersion>4.0.0</modelVersion>
77
<groupId>org.elasticsearch</groupId>
88
<artifactId>elasticsearch-mapper-attachments</artifactId>
9-
<version>1.10.0-SNAPSHOT</version>
9+
<version>2.0.0.RC1-SNAPSHOT</version>
1010
<packaging>jar</packaging>
1111
<description>Mapper Attachments Type for ElasticSearch</description>
1212
<inceptionYear>2009</inceptionYear>
@@ -30,7 +30,7 @@
3030
</parent>
3131

3232
<properties>
33-
<elasticsearch.version>0.90.10</elasticsearch.version>
33+
<elasticsearch.version>1.0.0.RC1-SNAPSHOT</elasticsearch.version>
3434
<lucene.version>4.6.0</lucene.version>
3535
<tests.jvms>1</tests.jvms>
3636
<tests.shuffle>true</tests.shuffle>

src/test/java/org/elasticsearch/index/mapper/xcontent/DateAttachmentMapperTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class DateAttachmentMapperTests extends ElasticsearchTestCase {
4141

4242
@Before
4343
public void setupMapperParser() {
44-
mapperParser = new DocumentMapperParser(new Index("test"), new AnalysisService(new Index("test")), null, null);
44+
mapperParser = new DocumentMapperParser(new Index("test"), new AnalysisService(new Index("test")), null, null, null);
4545
mapperParser.putTypeParser(AttachmentMapper.CONTENT_TYPE, new AttachmentMapper.TypeParser());
4646
}
4747

src/test/java/org/elasticsearch/index/mapper/xcontent/EncryptedDocMapperTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919

2020
package org.elasticsearch.index.mapper.xcontent;
2121

22-
import org.apache.lucene.document.Document;
2322
import org.elasticsearch.common.bytes.BytesReference;
2423
import org.elasticsearch.common.settings.ImmutableSettings;
2524
import org.elasticsearch.index.Index;
2625
import org.elasticsearch.index.analysis.AnalysisService;
2726
import org.elasticsearch.index.mapper.DocumentMapper;
2827
import org.elasticsearch.index.mapper.DocumentMapperParser;
2928
import org.elasticsearch.index.mapper.MapperParsingException;
29+
import org.elasticsearch.index.mapper.ParseContext;
3030
import org.elasticsearch.index.mapper.attachment.AttachmentMapper;
3131
import org.elasticsearch.test.ElasticsearchTestCase;
3232
import org.junit.Test;
@@ -47,7 +47,7 @@ public class EncryptedDocMapperTest extends ElasticsearchTestCase {
4747

4848
@Test
4949
public void testMultipleDocsEncryptedLast() throws IOException {
50-
DocumentMapperParser mapperParser = new DocumentMapperParser(new Index("test"), new AnalysisService(new Index("test")), null, null);
50+
DocumentMapperParser mapperParser = new DocumentMapperParser(new Index("test"), new AnalysisService(new Index("test")), null, null, null);
5151
mapperParser.putTypeParser(AttachmentMapper.CONTENT_TYPE, new AttachmentMapper.TypeParser());
5252

5353
String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/multipledocs/test-mapping.json");
@@ -62,7 +62,7 @@ public void testMultipleDocsEncryptedLast() throws IOException {
6262
.field("file2", pdf)
6363
.endObject().bytes();
6464

65-
Document doc = docMapper.parse(json).rootDoc();
65+
ParseContext.Document doc = docMapper.parse(json).rootDoc();
6666
assertThat(doc.get(docMapper.mappers().smartName("file1").mapper().names().indexName()), containsString("World"));
6767
assertThat(doc.get(docMapper.mappers().smartName("file1.title").mapper().names().indexName()), equalTo("Hello"));
6868
assertThat(doc.get(docMapper.mappers().smartName("file1.author").mapper().names().indexName()), equalTo("kimchy"));
@@ -80,7 +80,7 @@ public void testMultipleDocsEncryptedLast() throws IOException {
8080

8181
@Test
8282
public void testMultipleDocsEncryptedFirst() throws IOException {
83-
DocumentMapperParser mapperParser = new DocumentMapperParser(new Index("test"), new AnalysisService(new Index("test")), null, null);
83+
DocumentMapperParser mapperParser = new DocumentMapperParser(new Index("test"), new AnalysisService(new Index("test")), null, null, null);
8484
mapperParser.putTypeParser(AttachmentMapper.CONTENT_TYPE, new AttachmentMapper.TypeParser());
8585

8686
String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/multipledocs/test-mapping.json");
@@ -95,7 +95,7 @@ public void testMultipleDocsEncryptedFirst() throws IOException {
9595
.field("file2", html)
9696
.endObject().bytes();
9797

98-
Document doc = docMapper.parse(json).rootDoc();
98+
ParseContext.Document doc = docMapper.parse(json).rootDoc();
9999
assertThat(doc.get(docMapper.mappers().smartName("file1").mapper().names().indexName()), nullValue());
100100
assertThat(doc.get(docMapper.mappers().smartName("file1.title").mapper().names().indexName()), nullValue());
101101
assertThat(doc.get(docMapper.mappers().smartName("file1.author").mapper().names().indexName()), nullValue());
@@ -115,7 +115,7 @@ public void testMultipleDocsEncryptedFirst() throws IOException {
115115
public void testMultipleDocsEncryptedNotIgnoringErrors() throws IOException {
116116
DocumentMapperParser mapperParser = new DocumentMapperParser(new Index("test"),
117117
ImmutableSettings.builder().put("index.mapping.attachment.ignore_errors", false).build(),
118-
new AnalysisService(new Index("test")), null, null);
118+
new AnalysisService(new Index("test")), null, null, null);
119119
mapperParser.putTypeParser(AttachmentMapper.CONTENT_TYPE, new AttachmentMapper.TypeParser());
120120

121121
String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/multipledocs/test-mapping.json");
@@ -130,7 +130,7 @@ public void testMultipleDocsEncryptedNotIgnoringErrors() throws IOException {
130130
.field("file2", html)
131131
.endObject().bytes();
132132

133-
Document doc = docMapper.parse(json).rootDoc();
133+
ParseContext.Document doc = docMapper.parse(json).rootDoc();
134134
assertThat(doc.get(docMapper.mappers().smartName("file1").mapper().names().indexName()), nullValue());
135135
assertThat(doc.get(docMapper.mappers().smartName("file1.title").mapper().names().indexName()), nullValue());
136136
assertThat(doc.get(docMapper.mappers().smartName("file1.author").mapper().names().indexName()), nullValue());

src/test/java/org/elasticsearch/index/mapper/xcontent/MetadataMapperTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
package org.elasticsearch.index.mapper.xcontent;
2121

22-
import org.apache.lucene.document.Document;
2322
import org.elasticsearch.common.bytes.BytesReference;
2423
import org.elasticsearch.common.settings.ImmutableSettings;
2524
import org.elasticsearch.common.settings.Settings;
@@ -28,6 +27,7 @@
2827
import org.elasticsearch.index.mapper.DocumentMapper;
2928
import org.elasticsearch.index.mapper.DocumentMapperParser;
3029
import org.elasticsearch.index.mapper.MapperParsingException;
30+
import org.elasticsearch.index.mapper.ParseContext;
3131
import org.elasticsearch.index.mapper.attachment.AttachmentMapper;
3232
import org.elasticsearch.test.ElasticsearchTestCase;
3333
import org.junit.Test;
@@ -45,7 +45,7 @@
4545
public class MetadataMapperTest extends ElasticsearchTestCase {
4646

4747
protected void checkMeta(String filename, Settings settings, Long expectedDate, Long expectedLength) throws IOException {
48-
DocumentMapperParser mapperParser = new DocumentMapperParser(new Index("test"), settings, new AnalysisService(new Index("test")), null, null);
48+
DocumentMapperParser mapperParser = new DocumentMapperParser(new Index("test"), settings, new AnalysisService(new Index("test")), null, null, null);
4949
mapperParser.putTypeParser(AttachmentMapper.CONTENT_TYPE, new AttachmentMapper.TypeParser());
5050

5151
String mapping = copyToStringFromClasspath("/org/elasticsearch/index/mapper/xcontent/test-mapping.json");
@@ -61,7 +61,7 @@ protected void checkMeta(String filename, Settings settings, Long expectedDate,
6161
.endObject()
6262
.endObject().bytes();
6363

64-
Document doc = docMapper.parse(json).rootDoc();
64+
ParseContext.Document doc = docMapper.parse(json).rootDoc();
6565
assertThat(doc.get(docMapper.mappers().smartName("file").mapper().names().indexName()), containsString("World"));
6666
assertThat(doc.get(docMapper.mappers().smartName("file.name").mapper().names().indexName()), equalTo(filename));
6767
if (expectedDate == null) {

src/test/java/org/elasticsearch/index/mapper/xcontent/MultifieldAttachmentMapperTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class MultifieldAttachmentMapperTests extends ElasticsearchTestCase {
4242

4343
@Before
4444
public void setupMapperParser() {
45-
mapperParser = new DocumentMapperParser(new Index("test"), new AnalysisService(new Index("test")), null, null);
45+
mapperParser = new DocumentMapperParser(new Index("test"), new AnalysisService(new Index("test")), null, null, null);
4646
mapperParser.putTypeParser(AttachmentMapper.CONTENT_TYPE, new AttachmentMapper.TypeParser());
4747
}
4848

src/test/java/org/elasticsearch/index/mapper/xcontent/SimpleAttachmentMapperTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919

2020
package org.elasticsearch.index.mapper.xcontent;
2121

22-
import org.apache.lucene.document.Document;
2322
import org.elasticsearch.common.bytes.BytesReference;
2423
import org.elasticsearch.index.Index;
2524
import org.elasticsearch.index.analysis.AnalysisService;
2625
import org.elasticsearch.index.mapper.DocumentMapper;
2726
import org.elasticsearch.index.mapper.DocumentMapperParser;
27+
import org.elasticsearch.index.mapper.ParseContext;
2828
import org.elasticsearch.index.mapper.attachment.AttachmentMapper;
2929
import org.elasticsearch.test.ElasticsearchTestCase;
3030
import org.junit.Before;
@@ -45,7 +45,7 @@ public class SimpleAttachmentMapperTests extends ElasticsearchTestCase {
4545

4646
@Before
4747
public void setupMapperParser() {
48-
mapperParser = new DocumentMapperParser(new Index("test"), new AnalysisService(new Index("test")), null, null);
48+
mapperParser = new DocumentMapperParser(new Index("test"), new AnalysisService(new Index("test")), null, null, null);
4949
mapperParser.putTypeParser(AttachmentMapper.CONTENT_TYPE, new AttachmentMapper.TypeParser());
5050
}
5151

@@ -57,7 +57,7 @@ public void testSimpleMappings() throws Exception {
5757

5858
BytesReference json = jsonBuilder().startObject().field("_id", 1).field("file", html).endObject().bytes();
5959

60-
Document doc = docMapper.parse(json).rootDoc();
60+
ParseContext.Document doc = docMapper.parse(json).rootDoc();
6161

6262
assertThat(doc.get(docMapper.mappers().smartName("file.content_type").mapper().names().indexName()), equalTo("application/xhtml+xml"));
6363
assertThat(doc.get(docMapper.mappers().smartName("file.title").mapper().names().indexName()), equalTo("XHTML test document"));

src/test/java/org/elasticsearch/plugin/mapper/attachments/test/MultipleAttachmentIntegrationTests.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
import org.junit.Before;
2727
import org.junit.Test;
2828

29-
import static org.elasticsearch.client.Requests.*;
29+
import static org.elasticsearch.client.Requests.putMappingRequest;
3030
import static org.elasticsearch.common.io.Streams.copyToBytesFromClasspath;
3131
import static org.elasticsearch.common.io.Streams.copyToStringFromClasspath;
3232
import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder;
3333
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
34-
import static org.elasticsearch.index.query.QueryBuilders.fieldQuery;
34+
import static org.elasticsearch.index.query.QueryBuilders.queryString;
3535
import static org.hamcrest.Matchers.equalTo;
3636

3737
/**
@@ -72,10 +72,11 @@ public void testMultipleAttachmentsWithEncryptedDoc() throws Exception {
7272
index("test", "person", jsonBuilder().startObject().field("file1", html).field("file2", pdf).field("hello","world").endObject());
7373
refresh();
7474

75-
CountResponse countResponse = client().count(countRequest("test").query(fieldQuery("file1", "World"))).actionGet();
75+
76+
CountResponse countResponse = client().prepareCount("test").setQuery(queryString("World").defaultField("file1")).execute().get();
7677
assertThat(countResponse.getCount(), equalTo(1l));
7778

78-
countResponse = client().count(countRequest("test").query(fieldQuery("hello", "World"))).actionGet();
79+
countResponse = client().prepareCount("test").setQuery(queryString("World").defaultField("hello")).execute().get();
7980
assertThat(countResponse.getCount(), equalTo(1l));
8081
}
8182

src/test/java/org/elasticsearch/plugin/mapper/attachments/test/SimpleAttachmentIntegrationTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
import org.junit.Before;
2727
import org.junit.Test;
2828

29-
import static org.elasticsearch.client.Requests.*;
29+
import static org.elasticsearch.client.Requests.putMappingRequest;
3030
import static org.elasticsearch.common.io.Streams.copyToBytesFromClasspath;
3131
import static org.elasticsearch.common.io.Streams.copyToStringFromClasspath;
3232
import static org.elasticsearch.common.settings.ImmutableSettings.settingsBuilder;
3333
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
34-
import static org.elasticsearch.index.query.QueryBuilders.fieldQuery;
34+
import static org.elasticsearch.index.query.QueryBuilders.queryString;
3535
import static org.hamcrest.Matchers.equalTo;
3636

3737
/**
@@ -64,10 +64,10 @@ public void testSimpleAttachment() throws Exception {
6464
index("test", "person", jsonBuilder().startObject().field("file", html).endObject());
6565
refresh();
6666

67-
CountResponse countResponse = client().count(countRequest("test").query(fieldQuery("file.title", "test document"))).actionGet();
67+
CountResponse countResponse = client().prepareCount("test").setQuery(queryString("test document").defaultField("file.title")).execute().get();
6868
assertThat(countResponse.getCount(), equalTo(1l));
6969

70-
countResponse = client().count(countRequest("test").query(fieldQuery("file", "tests the ability"))).actionGet();
70+
countResponse = client().prepareCount("test").setQuery(queryString("tests the ability").defaultField("file")).execute().get();
7171
assertThat(countResponse.getCount(), equalTo(1l));
7272
}
7373

@@ -82,10 +82,10 @@ public void testSimpleAttachmentContentLengthLimit() throws Exception {
8282
index("test", "person", jsonBuilder().startObject().field("file").startObject().field("content", txt).field("_indexed_chars", CONTENT_LENGTH_LIMIT).endObject());
8383
refresh();
8484

85-
CountResponse countResponse = client().count(countRequest("test").query(fieldQuery("file", "BeforeLimit"))).actionGet();
85+
CountResponse countResponse = client().prepareCount("test").setQuery(queryString("BeforeLimit").defaultField("file")).execute().get();
8686
assertThat(countResponse.getCount(), equalTo(1l));
8787

88-
countResponse = client().count(countRequest("test").query(fieldQuery("file", "AfterLimit"))).actionGet();
88+
countResponse = client().prepareCount("test").setQuery(queryString("AfterLimit").defaultField("file")).execute().get();
8989
assertThat(countResponse.getCount(), equalTo(0l));
9090
}
9191

@@ -100,10 +100,10 @@ public void testSimpleAttachmentNoContentLengthLimit() throws Exception {
100100
index("test", "person", jsonBuilder().startObject().field("file").startObject().field("content", txt).field("_indexed_chars", CONTENT_LENGTH_LIMIT).endObject());
101101
refresh();
102102

103-
CountResponse countResponse = client().count(countRequest("test").query(fieldQuery("file", "Begin"))).actionGet();
103+
CountResponse countResponse = client().prepareCount("test").setQuery(queryString("Begin").defaultField("file")).execute().get();
104104
assertThat(countResponse.getCount(), equalTo(1l));
105105

106-
countResponse = client().count(countRequest("test").query(fieldQuery("file", "End"))).actionGet();
106+
countResponse = client().prepareCount("test").setQuery(queryString("End").defaultField("file")).execute().get();
107107
assertThat(countResponse.getCount(), equalTo(1l));
108108
}
109109

0 commit comments

Comments
 (0)