Select to view content in your preferred language

Harvesting SDE metadata: topic categories are put in keyword_s

111
2
Jump to solution
4 weeks ago
YinShi
by
Regular Contributor

After harvesting SDE metadata to Geoportal, I noticed topic categories were harvested to keywords_s field, i.e. the numeric values were topic categories. Is there any way I could harvest only keywords to keywords_s field and topic categories to another field in Elastic Search?

"keywords_s": [
"National Interest Land Mass",
"NILM",
"Masse des terrains d'intérêt national",
"MTIN",
"003",
"013",
"015"
],

I am thinking maybe collections and collection field names would rearrange the mapping but I am not sure. 

YinShi_0-1725024340195.png

0 Kudos
2 Solutions

Accepted Solutions
Marten
by
Regular Contributor

hi Yin,

this should be possible by updating the metadata evaluator for ArcGIS XML. When metadata is published to Geoportal Server, it is run through an evaluator (after determining which metadata type is submitted). The evaluator extracts fields from the XML and stores these in various fields in the index. The field suffix (_s, _dt, _l, ...) tells the search engine how to treat these fields (general text, tokenized words, dates, numbers, etc). 

The ArcGIS evaluator is found in: ..\geoportal\WEB-INF\classes\metadata\js\EvaluatorFor_ArcGIS.js.

Here you will see lines such as:

G.evalProps(task,item,root,"keywords_s","//TopicCatCd/@value | //keyword");

This particular line looks for the topic category code attribute that stores the 001, 002, ... codes. It also looks for keyword metadata elements. Then puts both of these in the field 'keyword_s'. You could change this to something like this:

G.evalProps(task,item,root,"keywords_s","//keyword");

G.evalProps(task,item,root,"topiccatcd_s","//TopicCatCd/@value");

to split keywords from topic category codes. 

you can even go as far as mapping the code values 001, 002, ... back to a human readable string and then store that in the index.

hope this helps,

M

 

 

View solution in original post

0 Kudos
YinShi
by
Regular Contributor

Thanks Marten, I was able to harvest Topic Categories to the correct attribute in ES. I also mapped the coded values for Topic Categories in  EvaluatorBase.js. The modified source code is attached. 

View solution in original post

0 Kudos
2 Replies
Marten
by
Regular Contributor

hi Yin,

this should be possible by updating the metadata evaluator for ArcGIS XML. When metadata is published to Geoportal Server, it is run through an evaluator (after determining which metadata type is submitted). The evaluator extracts fields from the XML and stores these in various fields in the index. The field suffix (_s, _dt, _l, ...) tells the search engine how to treat these fields (general text, tokenized words, dates, numbers, etc). 

The ArcGIS evaluator is found in: ..\geoportal\WEB-INF\classes\metadata\js\EvaluatorFor_ArcGIS.js.

Here you will see lines such as:

G.evalProps(task,item,root,"keywords_s","//TopicCatCd/@value | //keyword");

This particular line looks for the topic category code attribute that stores the 001, 002, ... codes. It also looks for keyword metadata elements. Then puts both of these in the field 'keyword_s'. You could change this to something like this:

G.evalProps(task,item,root,"keywords_s","//keyword");

G.evalProps(task,item,root,"topiccatcd_s","//TopicCatCd/@value");

to split keywords from topic category codes. 

you can even go as far as mapping the code values 001, 002, ... back to a human readable string and then store that in the index.

hope this helps,

M

 

 

0 Kudos
YinShi
by
Regular Contributor

Thanks Marten, I was able to harvest Topic Categories to the correct attribute in ES. I also mapped the coded values for Topic Categories in  EvaluatorBase.js. The modified source code is attached. 

0 Kudos