Index: solr/core/src/test/org/apache/solr/handler/HtmlStripFilterTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- solr/core/src/test/org/apache/solr/handler/HtmlStripFilterTest.java (revision ) +++ solr/core/src/test/org/apache/solr/handler/HtmlStripFilterTest.java (revision ) @@ -0,0 +1,63 @@ +package org.apache.solr.handler; + +/* + * 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. + */ + +import org.apache.solr.common.params.CommonParams; +import org.apache.solr.common.params.MapSolrParams; +import org.apache.solr.core.SolrCore; +import org.apache.solr.request.LocalSolrQueryRequest; +import org.apache.solr.request.SolrQueryRequest; +import org.apache.solr.util.AbstractSolrTestCase; + +import java.util.HashMap; +import java.util.Map; + +public class HtmlStripFilterTest extends AbstractSolrTestCase { + + @Override public String getSchemaFile() { return "schema-html-strip-filter.xml"; } + @Override public String getSolrConfigFile() { return "solrconfig.xml"; } + @Override public void setUp() throws Exception { + super.setUp(); + lrf = h.getRequestFactory("standard", 0, 20 ); + } + + public void testStripHtmlEntities(){ + SolrCore core = h.getCore(); + assertU(adoc("id", "1234", "label", "Bose® ™")); + assertU(commit()); + + Map args = new HashMap(); + args.put( CommonParams.Q, "label:bose" ); + args.put( "indent", "true" ); + SolrQueryRequest req = new LocalSolrQueryRequest( core, new MapSolrParams( args) ); + + assertQ("Make sure they got in", req + ,"//*[@numFound='1']" + ); + + args.put(CommonParams.Q, "label:174"); + assertQ("registered should not be found", req + , "//*[@numFound='0']" + ); + + args.put(CommonParams.Q, "label:8482"); + assertQ("TM should not be found", req + ,"//*[@numFound='0']" + ); + } +} Index: solr/core/src/test-files/solr/conf/schema-html-strip-filter.xml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- solr/core/src/test-files/solr/conf/schema-html-strip-filter.xml (revision ) +++ solr/core/src/test-files/solr/conf/schema-html-strip-filter.xml (revision ) @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + +