The location of the files you'll want to edit depend on which version of DSpace you are using, as the location of the primary JSP folder has changed in DSpace over the years.
[dspace]/config/dspace.cfg
[dspace-source]/dspace-api/src/main/resources/Messages.properties
[dspace-source]/dspace-jspui/src/main/webapp/search/advanced.jsp
[dspace]/config/dspace.cfg
[dspace-source]/dspace-api/src/main/resources/Messages.properties
[dspace-source]/dspace-jspui/dspace-jspui-webapp/src/main/webapp/
search/advanced.jsp
[dspace]/config/dspace.cfg
[dspace-source]/config/language-packs/Messages.properties
[dspace-source]/jsp/search/advanced.jsp
Beneath it you will see several lines like this:
search.index.1 = author:dc.contributor.* search.index.2 = author:dc.creator.* search.index.3 = title:dc.title.* search.index.4 = keyword:dc.subject.* search.index.5 = abstract:dc.description.abstract |
dc
) field to one of the existing "named indices", use the models above as a guide. If you wish to specify a different metadata schema, replace dc
with the other metadata schema's name.dc
) contributor
and creator
fields. Whereas, a search on "abstract" only searches the dc.description.abstract
field.If you want to add an entirely new search field, you will also have to modify Messages.properties (see Change page text (JSP) ) to add a user-friendly label for it, and the advanced-search JSP (advanced.jsp) to add an appropriate <option>
element, as below:
<option value="author" <%= field1.equals("author") ? "selected=\"selected\"" : "" %>><fmt:message key="jsp.search.advanced.type.author"/></option> |
<option>
element should correspond to the name of one of your search indices (e.g. author, title, keyword, etc.)search.index.#
fields in dspace.cfg), or the full text of the document (if it is full-text indexable). These search boxes perform what most refer to as a keyword or keyterm search.search.index.4 = keyword:dc.subject.
This (rather inappropriately named) index is actually used during subject specific searches (hence the subject.
). It does not have any control over a normal keyword search that is run from the basic search box in DSpace.