From 8cf98a75fa116fed939c514d0348100f0b647499 Mon Sep 17 00:00:00 2001 From: briancaruso Date: Thu, 8 Dec 2011 18:40:49 +0000 Subject: [PATCH] Changing solr analysis for name, NIHVIVO-3332. Attempting to remove duplicate strings due to copy fields in Solr index. --- solr/homeDirectoryTemplate/conf/schema.xml | 243 ++---------------- .../search/solr/IndividualToSolrDocument.java | 9 +- 2 files changed, 30 insertions(+), 222 deletions(-) diff --git a/solr/homeDirectoryTemplate/conf/schema.xml b/solr/homeDirectoryTemplate/conf/schema.xml index 081dfadc3..9f7c3e987 100644 --- a/solr/homeDirectoryTemplate/conf/schema.xml +++ b/solr/homeDirectoryTemplate/conf/schema.xml @@ -1,43 +1,7 @@ - - - - - + - - @@ -46,108 +10,22 @@ - - - - + - - + - - - - - - - - + @@ -157,7 +35,7 @@ - + - - + + - - + + - + - + @@ -207,17 +77,15 @@ + - + + @@ -234,6 +102,7 @@ + @@ -278,35 +147,7 @@ - - - + @@ -352,13 +193,12 @@ - + - @@ -369,8 +209,7 @@ - - + @@ -390,62 +229,34 @@ - + + + + - - - + Unless this field is marked with required="false", it will be a required field --> DocId - + + - - - - - - - - - - - - - - - + diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/solr/IndividualToSolrDocument.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/solr/IndividualToSolrDocument.java index 8182690bf..66529aa43 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/search/solr/IndividualToSolrDocument.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/search/solr/IndividualToSolrDocument.java @@ -204,13 +204,10 @@ public class IndividualToSolrDocument { } else { value = ind.getLocalName(); } + doc.addField(term.NAME_RAW, value); - doc.addField(term.NAME_LOWERCASE, value); - doc.addField(term.NAME_UNSTEMMED, value); - doc.addField(term.NAME_STEMMED, value); - doc.addField(term.NAME_PHONETIC, value); - doc.addField(term.AC_NAME_UNTOKENIZED, value); - doc.addField(term.AC_NAME_STEMMED, value); + // NAME_RAW will be copied by solr into the following fields: + // NAME_LOWERCASE, NAME_UNSTEMMED, NAME_STEMMED, NAME_PHONETIC, AC_NAME_UNTOKENIZED, AC_NAME_STEMMED } /**