Sunday, 24 June 2012

Adding Full Text Search to your Oracc 2 project portal

(FOR ORACC PROJECT MANAGERS)

One of Oracc 2's new functionalities is the Full Text Search across the whole of the site. There is a new documentation page about how to use it.

It is also very easy to enable users to do Full Text Search on your project alone, from one or more portal pages of your project. To do so you will need to edit them with Emacs or an XHTML editor.

  • First add this line of code somewhere within the head element of the page, ideally with the other link elements:

    <link rel="stylesheet" type="/css/oraccbase.css"/>

    EDIT: This is now built into the main Oracc stylesheet.

  • Then add this code wherever you want it to appear in the body of your web page, replacing [PROJECT] with the name of your project:

    <span class="find-button"><a href="/[PROJECT]/find">Full 
    Text Search</a></span>

    For instance, you might add a link to the online help:

    <p>Do a <span class="find-button"><a href="/cams/find">Full 
    Text Search</a></span> in CAMS 
    <a href="/doc/user/fulltextsearch/">[HELP]</a>.</p>

    EDITED TO ADD:

    If you are working with ESP, use <esp:link url="/[PROJECT]/find">...</esp:link> instead of <a href="/[PROJECT]/find">...</a>. The necessary CSS code is already built into ESP's stylesheet.

    This is displayed in the browser as:

    Do a Full Text Search in CAMS [HELP].

  • Finally, don't forget to run oracc web to make it go live online.

Note that this does not replace the existing text, catalogue and glossary search functions, but allows users to search across the whole of your project, including portal pages. That does mean though that it is not very sensitive to the type of data it is searching, and returns rather rough and ready results. In particular, at the moment it privileges glossary entries but Steve is improving the way it returns results all the time.

As always, please let me know if you need assistance.

No comments:

Post a Comment