@@ -299,6 +299,10 @@ class ElasticsearchPlugin(application: Application) extends Plugin {
299299 .startObject(" default" )
300300 .field(" type" , " standard" )
301301 .endObject()
302+ .startObject(" email_analyzer" )
303+ .field(" type" , " custom" )
304+ .field(" tokenizer" , " uax_url_email" )
305+ .endObject()
302306 .endObject()
303307 .endObject()
304308 .startObject(" index" )
@@ -710,7 +714,7 @@ class ElasticsearchPlugin(application: Application) extends Plugin {
710714 |"parent_of": {"type": "string", "include_in_all": false},
711715 |"creator": {"type": "string", "include_in_all": false},
712716 |"creator_name": {"type": "string"},
713- |"creator_email": {"type": "string"},
717+ |"creator_email": {"type": "string", "search_analyzer": "email_analyzer", "analyzer": "email_analyzer" },
714718 |"created_as": {"type": "string"},
715719 |"created": {"type": "date", "format": "dateOptionalTime", "include_in_all": false},
716720 |"metadata": {"type": "object"},
@@ -844,7 +848,7 @@ class ElasticsearchPlugin(application: Application) extends Plugin {
844848 }
845849
846850 // If a term is specified that isn't in this list, it's assumed to be a metadata field
847- val official_terms = List (" name" , " creator" , " resource_type" , " in" , " contains" , " tag" )
851+ val official_terms = List (" name" , " creator" , " email " , " resource_type" , " in" , " contains" , " tag" )
848852
849853 // Create list of "key:value" terms for parsing by builder
850854 val terms = ListBuffer [String ]()
@@ -859,6 +863,10 @@ class ElasticsearchPlugin(application: Application) extends Plugin {
859863 currterm += " child_of:"
860864 else if (mt == " contains" )
861865 currterm += " parent_of:"
866+ else if (mt == " creator" )
867+ currterm += " creator_name:"
868+ else if (mt == " email" )
869+ currterm += " creator_email:"
862870 else if (! official_terms.contains(mt))
863871 currterm += " metadata." + mt+ " :"
864872 else
0 commit comments