You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2017/04/28 19:39:39 UTC
[1/2] lucene-solr:master: SOLR-9596: Add Solr support for
SimpleTextCodec,
via in solrconfig.xml
(per-field specification in the schema is not possible).
Repository: lucene-solr
Updated Branches:
refs/heads/branch_6x 303c2a083 -> abacb2fe6
refs/heads/master 57f17b111 -> e2521b2a8
SOLR-9596: Add Solr support for SimpleTextCodec, via <codecFactory class=solr.SimpleTextCodecFactory/> in solrconfig.xml (per-field specification in the schema is not possible).
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/e2521b2a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/e2521b2a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/e2521b2a
Branch: refs/heads/master
Commit: e2521b2a8baabdaf43b92192588f51e042d21e97
Parents: 57f17b1
Author: Steve Rowe <sa...@apache.org>
Authored: Fri Apr 28 15:36:50 2017 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Fri Apr 28 15:36:50 2017 -0400
----------------------------------------------------------------------
dev-tools/idea/solr/core/src/java/solr-core.iml | 1 +
solr/CHANGES.txt | 3 +
.../solr/core/SimpleTextCodecFactory.java | 38 +++++++++++
.../collection1/conf/schema-SimpleTextCodec.xml | 32 ++++++++++
.../conf/solrconfig_SimpleTextCodec.xml | 26 ++++++++
.../apache/solr/core/TestSimpleTextCodec.java | 67 ++++++++++++++++++++
6 files changed, 167 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e2521b2a/dev-tools/idea/solr/core/src/java/solr-core.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/solr/core/src/java/solr-core.iml b/dev-tools/idea/solr/core/src/java/solr-core.iml
index 6cf1ab1..61387b9 100644
--- a/dev-tools/idea/solr/core/src/java/solr-core.iml
+++ b/dev-tools/idea/solr/core/src/java/solr-core.iml
@@ -32,5 +32,6 @@
<orderEntry type="module" module-name="join" />
<orderEntry type="module" module-name="sandbox" />
<orderEntry type="module" module-name="backward-codecs" />
+ <orderEntry type="module" module-name="codecs" />
</component>
</module>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e2521b2a/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 8f1fe87..81288d8 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -196,6 +196,9 @@ New Features
* SOLR-10521: introducing sort=childfield(field) asc for searching by {!parent} (Mikhail Khludnev)
+* SOLR-9596: Add Solr support for SimpleTextCodec, via <codecFactory class="solr.SimpleTextCodecFactory"/>
+ in solrconfig.xml (per-field specification in the schema is not possible). (Steve Rowe)
+
Optimizations
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e2521b2a/solr/core/src/java/org/apache/solr/core/SimpleTextCodecFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SimpleTextCodecFactory.java b/solr/core/src/java/org/apache/solr/core/SimpleTextCodecFactory.java
new file mode 100644
index 0000000..de0124f
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/core/SimpleTextCodecFactory.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.core;
+
+import org.apache.lucene.codecs.Codec;
+import org.apache.lucene.codecs.simpletext.SimpleTextCodec;
+import org.apache.solr.common.util.NamedList;
+
+public class SimpleTextCodecFactory extends CodecFactory {
+ private Codec codec;
+
+ @Override
+ public void init(NamedList args) {
+ super.init(args);
+ assert codec == null;
+ codec = new SimpleTextCodec();
+ }
+
+ @Override
+ public Codec getCodec() {
+ return codec;
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e2521b2a/solr/core/src/test-files/solr/collection1/conf/schema-SimpleTextCodec.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-SimpleTextCodec.xml b/solr/core/src/test-files/solr/collection1/conf/schema-SimpleTextCodec.xml
new file mode 100644
index 0000000..528de73
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-SimpleTextCodec.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<schema name="SimpleTextCodec" version="1.6">
+ <fieldType name="string" class="solr.StrField"/>
+
+ <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
+ <analyzer>
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ </fieldType>
+
+ <field name="id" type="string" indexed="true" stored="true" docValues="true" required="true"/>
+ <field name="text" type="text_general" indexed="true" stored="true"/>
+
+ <uniqueKey>id</uniqueKey>
+</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e2521b2a/solr/core/src/test-files/solr/collection1/conf/solrconfig_SimpleTextCodec.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig_SimpleTextCodec.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig_SimpleTextCodec.xml
new file mode 100644
index 0000000..f3abf9b
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig_SimpleTextCodec.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<config>
+ <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
+ <schemaFactory class="ClassicIndexSchemaFactory"/>
+ <requestHandler name="standard" class="solr.StandardRequestHandler"/>
+ <codecFactory class="solr.SimpleTextCodecFactory"/>
+</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e2521b2a/solr/core/src/test/org/apache/solr/core/TestSimpleTextCodec.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestSimpleTextCodec.java b/solr/core/src/test/org/apache/solr/core/TestSimpleTextCodec.java
new file mode 100644
index 0000000..f019f3b
--- /dev/null
+++ b/solr/core/src/test/org/apache/solr/core/TestSimpleTextCodec.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.core;
+
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.SegmentInfo;
+import org.apache.lucene.index.SegmentInfos;
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.search.SolrIndexSearcher;
+import org.apache.solr.util.RefCounted;
+import org.junit.BeforeClass;
+
+public class TestSimpleTextCodec extends SolrTestCaseJ4 {
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ initCore("solrconfig_SimpleTextCodec.xml", "schema-SimpleTextCodec.xml");
+ }
+
+ public void test() throws Exception {
+ SolrConfig config = h.getCore().getSolrConfig();
+ String codecFactory = config.get("codecFactory/@class");
+ assertEquals("Unexpected solrconfig codec factory", "solr.SimpleTextCodecFactory", codecFactory);
+
+ assertEquals("Unexpected core codec", "SimpleText", h.getCore().getCodec().getName());
+
+ RefCounted<IndexWriter> writerRef = h.getCore().getSolrCoreState().getIndexWriter(h.getCore());
+ try {
+ IndexWriter writer = writerRef.get();
+ assertEquals("Unexpected codec in IndexWriter config",
+ "SimpleText", writer.getConfig().getCodec().getName());
+ } finally {
+ writerRef.decref();
+ }
+
+ assertU(add(doc("id","1", "text","textual content goes here")));
+ assertU(commit());
+
+ RefCounted<SolrIndexSearcher> searcherRef = h.getCore().getSearcher();
+ try {
+ SolrIndexSearcher searcher = searcherRef.get();
+ SegmentInfos infos = SegmentInfos.readLatestCommit(searcher.getIndexReader().directory());
+ SegmentInfo info = infos.info(infos.size() - 1).info;
+ assertEquals("Unexpected segment codec", "SimpleText", info.getCodec().getName());
+ } finally {
+ searcherRef.decref();
+ }
+
+ assertQ(req("q", "id:1"),
+ "*[count(//doc)=1]");
+ }
+}
[2/2] lucene-solr:branch_6x: SOLR-9596: Add Solr support for
SimpleTextCodec,
via in solrconfig.xml
(per-field specification in the schema is not possible).
Posted by sa...@apache.org.
SOLR-9596: Add Solr support for SimpleTextCodec, via <codecFactory class=solr.SimpleTextCodecFactory/> in solrconfig.xml (per-field specification in the schema is not possible).
Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/abacb2fe
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/abacb2fe
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/abacb2fe
Branch: refs/heads/branch_6x
Commit: abacb2fe6ff5ad12f5a05fca642984dc9c012323
Parents: 303c2a0
Author: Steve Rowe <sa...@apache.org>
Authored: Fri Apr 28 15:36:50 2017 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Fri Apr 28 15:39:19 2017 -0400
----------------------------------------------------------------------
dev-tools/idea/solr/core/src/java/solr-core.iml | 1 +
solr/CHANGES.txt | 3 +
.../solr/core/SimpleTextCodecFactory.java | 38 +++++++++++
.../collection1/conf/schema-SimpleTextCodec.xml | 32 ++++++++++
.../conf/solrconfig_SimpleTextCodec.xml | 26 ++++++++
.../apache/solr/core/TestSimpleTextCodec.java | 67 ++++++++++++++++++++
6 files changed, 167 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abacb2fe/dev-tools/idea/solr/core/src/java/solr-core.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/solr/core/src/java/solr-core.iml b/dev-tools/idea/solr/core/src/java/solr-core.iml
index 822b24f..7a1e050 100644
--- a/dev-tools/idea/solr/core/src/java/solr-core.iml
+++ b/dev-tools/idea/solr/core/src/java/solr-core.iml
@@ -31,5 +31,6 @@
<orderEntry type="module" module-name="queryparser" />
<orderEntry type="module" module-name="join" />
<orderEntry type="module" module-name="sandbox" />
+ <orderEntry type="module" module-name="codecs" />
</component>
</module>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abacb2fe/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index d6f36bf..630b06c 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -89,6 +89,9 @@ New Features
* SOLR-10521: introducing sort=childfield(field) asc for searching by {!parent} (Mikhail Khludnev)
+* SOLR-9596: Add Solr support for SimpleTextCodec, via <codecFactory class="solr.SimpleTextCodecFactory"/>
+ in solrconfig.xml (per-field specification in the schema is not possible). (Steve Rowe)
+
Optimizations
----------------------
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abacb2fe/solr/core/src/java/org/apache/solr/core/SimpleTextCodecFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/core/SimpleTextCodecFactory.java b/solr/core/src/java/org/apache/solr/core/SimpleTextCodecFactory.java
new file mode 100644
index 0000000..de0124f
--- /dev/null
+++ b/solr/core/src/java/org/apache/solr/core/SimpleTextCodecFactory.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.core;
+
+import org.apache.lucene.codecs.Codec;
+import org.apache.lucene.codecs.simpletext.SimpleTextCodec;
+import org.apache.solr.common.util.NamedList;
+
+public class SimpleTextCodecFactory extends CodecFactory {
+ private Codec codec;
+
+ @Override
+ public void init(NamedList args) {
+ super.init(args);
+ assert codec == null;
+ codec = new SimpleTextCodec();
+ }
+
+ @Override
+ public Codec getCodec() {
+ return codec;
+ }
+}
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abacb2fe/solr/core/src/test-files/solr/collection1/conf/schema-SimpleTextCodec.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/schema-SimpleTextCodec.xml b/solr/core/src/test-files/solr/collection1/conf/schema-SimpleTextCodec.xml
new file mode 100644
index 0000000..528de73
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/schema-SimpleTextCodec.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<schema name="SimpleTextCodec" version="1.6">
+ <fieldType name="string" class="solr.StrField"/>
+
+ <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
+ <analyzer>
+ <tokenizer class="solr.StandardTokenizerFactory"/>
+ <filter class="solr.LowerCaseFilterFactory"/>
+ </analyzer>
+ </fieldType>
+
+ <field name="id" type="string" indexed="true" stored="true" docValues="true" required="true"/>
+ <field name="text" type="text_general" indexed="true" stored="true"/>
+
+ <uniqueKey>id</uniqueKey>
+</schema>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abacb2fe/solr/core/src/test-files/solr/collection1/conf/solrconfig_SimpleTextCodec.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig_SimpleTextCodec.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig_SimpleTextCodec.xml
new file mode 100644
index 0000000..f3abf9b
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig_SimpleTextCodec.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<config>
+ <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+ <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
+ <schemaFactory class="ClassicIndexSchemaFactory"/>
+ <requestHandler name="standard" class="solr.StandardRequestHandler"/>
+ <codecFactory class="solr.SimpleTextCodecFactory"/>
+</config>
http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/abacb2fe/solr/core/src/test/org/apache/solr/core/TestSimpleTextCodec.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestSimpleTextCodec.java b/solr/core/src/test/org/apache/solr/core/TestSimpleTextCodec.java
new file mode 100644
index 0000000..f019f3b
--- /dev/null
+++ b/solr/core/src/test/org/apache/solr/core/TestSimpleTextCodec.java
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.core;
+
+import org.apache.lucene.index.IndexWriter;
+import org.apache.lucene.index.SegmentInfo;
+import org.apache.lucene.index.SegmentInfos;
+import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.search.SolrIndexSearcher;
+import org.apache.solr.util.RefCounted;
+import org.junit.BeforeClass;
+
+public class TestSimpleTextCodec extends SolrTestCaseJ4 {
+
+ @BeforeClass
+ public static void beforeClass() throws Exception {
+ initCore("solrconfig_SimpleTextCodec.xml", "schema-SimpleTextCodec.xml");
+ }
+
+ public void test() throws Exception {
+ SolrConfig config = h.getCore().getSolrConfig();
+ String codecFactory = config.get("codecFactory/@class");
+ assertEquals("Unexpected solrconfig codec factory", "solr.SimpleTextCodecFactory", codecFactory);
+
+ assertEquals("Unexpected core codec", "SimpleText", h.getCore().getCodec().getName());
+
+ RefCounted<IndexWriter> writerRef = h.getCore().getSolrCoreState().getIndexWriter(h.getCore());
+ try {
+ IndexWriter writer = writerRef.get();
+ assertEquals("Unexpected codec in IndexWriter config",
+ "SimpleText", writer.getConfig().getCodec().getName());
+ } finally {
+ writerRef.decref();
+ }
+
+ assertU(add(doc("id","1", "text","textual content goes here")));
+ assertU(commit());
+
+ RefCounted<SolrIndexSearcher> searcherRef = h.getCore().getSearcher();
+ try {
+ SolrIndexSearcher searcher = searcherRef.get();
+ SegmentInfos infos = SegmentInfos.readLatestCommit(searcher.getIndexReader().directory());
+ SegmentInfo info = infos.info(infos.size() - 1).info;
+ assertEquals("Unexpected segment codec", "SimpleText", info.getCodec().getName());
+ } finally {
+ searcherRef.decref();
+ }
+
+ assertQ(req("q", "id:1"),
+ "*[count(//doc)=1]");
+ }
+}