Include new fields in advanced search.

65 views
Skip to first unread message

amarildo rod

unread,
Nov 6, 2015, 10:07:48 AM11/6/15
to ICA-AtoM Users
Dear, we use AtoM 2.1.2 version and would like to include in Advanced Search the following fields:

-creatorHistory
-dates
-notes
-creators

What changes do I need the source code to be able to search these fields ?

Could anyone help ?

Files that try to change :
apps/qubit/modules/search/templates/_searchFields.php
apps/qubit/modules/search/actions/advancedAction.class.php

Thank you

Amarildo Oliveira.

José Raddaoui

unread,
Nov 10, 2015, 2:06:41 PM11/10/15
to ICA-AtoM Users
Hello Amarildo,

You were looking to the right files. You'll need to do the following changes:

- Add new options after this two lines:


- Add new cases in the following switch, using the new option values as the case names, like this one:


- For the fields you're looking, you'll need to change the lines setting the field to:

creatorHistory -> $queryField->setFields(arElasticSearchPluginUtil::getI18nFieldNames('creators.i18n.%s.history'));
dates          -> $queryField->setFields(arElasticSearchPluginUtil::getI18nFieldNames('dates.i18n.%s.date')); 
notes          -> $queryField->setFields(arElasticSearchPluginUtil::getI18nFieldNames('generalNotes.i18n.%s.content'));
creators       -> $queryField->setFields(arElasticSearchPluginUtil::getI18nFieldNames('creators.i18n.%s.authorizedFormOfName'));

I think that's all. Let us know how it goes and if you need anything else.

Best regards.

Dan Gillean

unread,
Nov 10, 2015, 2:28:56 PM11/10/15
to ICA-AtoM Users
And, if you succeed, perhaps consider sending us a pull request!

You will find some helpful resources for doing so on our wiki, here:

Good luck!


Dan Gillean, MAS, MLIS
AtoM Product Manager / Systems Analyst,
Artefactual Systems, Inc.
604-527-2056
@accesstomemory

--
You received this message because you are subscribed to the Google Groups "ICA-AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To post to this group, send email to ica-ato...@googlegroups.com.
Visit this group at http://groups.google.com/group/ica-atom-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/7d2fcc47-d197-419e-b3f8-e17028d7be4e%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

amarildo rod

unread,
Nov 12, 2015, 6:33:51 AM11/12/15
to ICA-AtoM Users
Thank you José.

I will validate the research done with the new fields and report to the group.
Add new fields in advanced research as below:

relatedUnitsOfDescription -> $queryField->setFields(arElasticSearchPluginUtil::getI18nFieldNames('i18n.%s.relatedUnitsOfDescription'));
accessConditions            -> $queryField->setFields(arElasticSearchPluginUtil::getI18nFieldNames('i18n.%s.accessConditions'));
acquisition                      -> $queryField->setFields(arElasticSearchPluginUtil::getI18nFieldNames('i18n.%s.acquisition'));

These fields are correct?
Where can I find the correct name to enter the advanced search as an example (creators.i18n.%s.history)?


Thank you for your help.

Amarildo Oliveira.

José Raddaoui

unread,
Nov 12, 2015, 7:04:53 AM11/12/15
to ICA-AtoM Users
Hi Amarildo,

Yes, those fields are correct.

The Elasticsearch index created for AtoM can't be seen easily in the AtoM code, it's created parsing the following YML file:


Plus the i18n fields from the database schema:


The best way to see all the fields in the Elasticsearch index is asking directly to the ES server, using cURL or installing the 'elasticseach-head' plugin. Not sure if that's what you're asking in the second question.

Regards.

amarildo rod

unread,
Nov 12, 2015, 8:18:41 AM11/12/15
to ICA-AtoM Users
Ok José.

The second question I would like to understand how the structure below is created:

Exemple:
creators.i18n.%s.history

creators -> ?
i18n -> ?
%s -> ?
history -> ?

This information comes from where?

Thank´s

José Raddaoui

unread,
Nov 12, 2015, 3:55:08 PM11/12/15
to ICA-AtoM Users
Hi Amarildo,

We're querying to the Elasticsearch information object index in that page. In that index, the creators are stored as a multi-field called 'creators' with the authority record data. Inside the creators field the multi-culture fields are stored in other multi-field called 'i18n', where each enabled culture is stored in a different group 'en', 'es', 'fr', etc. Then, inside each culture group you can find the actual authority record fields.

arElasticSearchPluginUtil::getI18nFieldNames('creators.i18n.%s.history') is as helper function that uses your language settings to get the actual field names. For example, if you have English, French and Spanish enabled in your AtoM instance, that function will return 'creators.i18n.en.history, creators.i18n.fr.history, creators.i18n.es.history'.

I hope that helps.

Regards.

amarildo rod

unread,
Nov 16, 2015, 5:06:55 AM11/16/15
to ICA-AtoM Users
Hi José.
Thank you for the information.
Reply all
Reply to author
Forward
0 new messages