Skip to content

Commit

Permalink
Reviewving schema
Browse files Browse the repository at this point in the history
  • Loading branch information
romanchyla committed Nov 25, 2014
1 parent dc32c6a commit 25f308f
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 160 deletions.
2 changes: 1 addition & 1 deletion .classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="lib" path="build/solrjars-extracted/lucene-test-framework-4.8-SNAPSHOT.jar" sourcepath="build/solr-download/apache-solr-4.0.0-SVN/lucene/test-framework/src/java"/>
<classpathentry kind="lib" path="build/solrjars-extracted/solr-test-framework-4.8-SNAPSHOT.jar" sourcepath="build/solr-download/apache-solr-4.0.0-SVN/lucene/core/src"/>
<classpathentry kind="lib" path="build/solrjars-extracted/solr-test-framework-4.8-SNAPSHOT.jar" sourcepath="/solr-next"/>
<classpathentry kind="src" path="contrib/antlrqueryparser/src/java"/>
<classpathentry kind="src" path="contrib/adsabs/src/jython"/>
<classpathentry kind="src" path="contrib/antlrqueryparser/src/test"/>
Expand Down
1 change: 1 addition & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<name>montysolr-next</name>
<comment></comment>
<projects>
<project>solr-next</project>
</projects>
<buildSpec>
<buildCommand>
Expand Down
10 changes: 6 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,14 @@



<target name="test" depends="write-properties">
<antcall target="common.test" inheritall="true" inheritrefs="true"/>
</target>
<target name="test" depends="write-properties" description="Run tests for core and contrib">
<antcall target="common.test" inheritall="true" inheritrefs="true"/>
<antcall target="test-contrib" inheritall="true" inheritrefs="true"/>
</target>


<target name="test-all" depends="test,test-contrib" description="Run tests for core and contrib"/>
<!-- obsolete: redirecting to test -->
<target name="test-all" depends="test" />


<!-- writes into a simple format various config variables, they can be used by unittests/java -->
Expand Down
8 changes: 6 additions & 2 deletions contrib/adsabs/src/test/org/adsabs/TestAdsAllFields.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void test() throws Exception {
", \"alternate_title\": \"This is of the alternate\"" +
", \"abstract\": \"all no-sky survey q'i quotient\"" +

", \"keyword\": [\"Classical statistical mechanics\"]" +
", \"keyword\": [\"Classical statistical mechanics\", \"foo bar\"]" +
", \"keyword_norm\": [\"angular momentum\", \"89.20.Hh\"]" +
", \"keyword_schema\": [\"ADS\", \"PACS Codes\"]" +
", \"keyword_facet\": [\"angular momentum kw\"]" +
Expand Down Expand Up @@ -504,6 +504,10 @@ public void test() throws Exception {
"//*[@numFound='1']",
"//doc/int[@name='recid'][.='100']"
);
assertQ(req("q", "keyword:\"foo bar\""),
"//*[@numFound='1']",
"//doc/int[@name='recid'][.='100']"
);
assertQ(req("q", "keyword:\"Classical Statistical Mechanics\""), // should be case-insensitive
"//*[@numFound='1']",
"//doc/int[@name='recid'][.='100']"
Expand All @@ -520,7 +524,7 @@ public void test() throws Exception {
);

assertQ(req("q", "keyword_norm:classical"), "//*[@numFound='0']"); // should not contain keywords
assertQ(req("q", "keyword:89.20.Hh"), "//*[@numFound='1']"); // should contain keywords_norm
assertQ(req("q", "keyword:89.20.Hh"), "//*[@numFound='0']"); // should not contain keywords_norm


/*
Expand Down
53 changes: 18 additions & 35 deletions contrib/examples/adsabs/solr/collection1/conf/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,12 @@

<!-- remove stop words - first the case sensitively -->
<filter class="solr.StopFilterFactory" ignoreCase="false"
words="text.kill_sens" enablePositionIncrements="false" />
words="text.kill_sens" enablePositionIncrements="false"
luceneMatchVersion="4.3"/>
<!-- remove stop words - then case insensitively -->
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="text.kill" enablePositionIncrements="false" />
words="text.kill" enablePositionIncrements="false"
luceneMatchVersion="4.3"/>



Expand Down Expand Up @@ -537,10 +539,12 @@

<!-- remove stop words - first the case sensitively -->
<filter class="solr.StopFilterFactory" ignoreCase="false"
words="text.kill_sens" enablePositionIncrements="false" />
words="text.kill_sens" enablePositionIncrements="false"
luceneMatchVersion="4.3"/>
<!-- remove stop words - then case insensitively -->
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="text.kill" enablePositionIncrements="false" />
words="text.kill" enablePositionIncrements="false"
luceneMatchVersion="4.3"/>



Expand Down Expand Up @@ -609,10 +613,12 @@

<!-- remove stop words - first the case sensitively -->
<filter class="solr.StopFilterFactory" ignoreCase="false"
words="text.kill_sens" enablePositionIncrements="false" />
words="text.kill_sens" enablePositionIncrements="false"
luceneMatchVersion="4.3"/>
<!-- remove stop words - then case insensitively -->
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="text.kill" enablePositionIncrements="false" />
words="text.kill" enablePositionIncrements="false"
luceneMatchVersion="4.3"/>



Expand Down Expand Up @@ -679,6 +685,8 @@
<filter class="solr.PatternReplaceFilterFactory" pattern="(doi:|arxiv:)"
replacement="" replace="all" />
<filter class="solr.TrimFilterFactory" />
<filter
class="org.apache.lucene.analysis.miscellaneous.RemoveDuplicatesTokenFilterFactory" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory" />
Expand Down Expand Up @@ -773,6 +781,8 @@
<filter class="solr.PatternReplaceFilterFactory" pattern="(\-|_| )"
replacement="" replace="all" />
<filter class="solr.TrimFilterFactory" />
<filter
class="org.apache.lucene.analysis.miscellaneous.RemoveDuplicatesTokenFilterFactory" />
</analyzer>
<analyzer type="query">
<tokenizer class="solr.KeywordTokenizerFactory" />
Expand Down Expand Up @@ -1050,6 +1060,8 @@

<field name="page" type="first_string" indexed="true" stored="true"
multiValued="true" omitNorms="true" omitTermFreqAndPositions="true"/>
<field name="eid" type="first_string" indexed="true" stored="true"
multiValued="true" omitNorms="true" omitTermFreqAndPositions="true"/>

<field name="year" type="first_string" indexed="true" stored="true"
multiValued="false" omitNorms="true" omitTermFreqAndPositions="true"/>
Expand Down Expand Up @@ -1079,9 +1091,6 @@
<field name="pubdate" type="date_string" indexed="true" stored="true"
omitNorms="true" omitTermFreqAndPositions="true"/>

<field name="pubdate_sort" type="int" indexed="true" stored="${storeAll:false}"
omitNorms="true" omitTermFreqAndPositions="true"/>


<field name="title" type="ads_text" indexed="true" stored="true"
multiValued="true" termVectors="true" termOffsets="true"
Expand Down Expand Up @@ -1460,33 +1469,7 @@
<solrQueryParser defaultOperator="AND" />

<copyField source="id" dest="recid" />

<copyField source="arxiv_class" dest="keyword" />
<copyField source="keyword_norm" dest="keyword" />

<copyField source="bibgroup" dest="bibgroup_facet" />
<copyField source="data" dest="data_facet" />
<copyField source="vizier" dest="vizier_facet" />

<copyField source="a_100" dest="author" />
<copyField source="a_700" dest="author" />

<copyField source="a_100_norm" dest="author_norm" />
<copyField source="a_700_norm" dest="author_norm" />

<copyField source="a_100_norm" dest="author_facet" />
<copyField source="a_700_norm" dest="author_facet" />

<copyField source="a_100" dest="first_author" />
<copyField source="a_100_norm" dest="first_author_norm" />

<copyField source="tmp_aff_100" dest="aff" />
<copyField source="tmp_aff_700" dest="aff" />

<copyField source="tmp_email_100" dest="email" />
<copyField source="tmp_email_700" dest="email" />


<copyField source="bibcode" dest="identifier" />
<copyField source="alternate_bibcode" dest="identifier" />
<copyField source="doi" dest="identifier" />
Expand Down
Loading

0 comments on commit 25f308f

Please sign in to comment.