Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the CollectiveAccess support forum! Here the developers and community answer questions related to use of the software. Please include the following information in every new issue posted here:

  1. Version of the software that is used, along with browser and version

  2. If the issue pertains to Providence, Pawtucket or both

  3. What steps you’ve taken to try to resolve the issue

  4. Screenshots demonstrating the issue

  5. The relevant sections of your installation profile or configuration including the codes and settings defined for your local elements.

If your question pertains to data import or export, please also include:

  1. Data sample

  2. Your mapping

Answers may be delayed for posts that do not include sufficient information.

Related Object View

edited June 2016 in Pawtucket
I'm trying to get two of my pages to mimic each other in terms of how they show related objects. The first image is of a places detail page with a list of related objects. The second image is of an objects page with a list of related objects. I'd like my objects detail page to mirror the display of the thumbnails in the places detail page layout. How can I fix this? The code for both detail pages is also attached. 




  • Hi Morgan,

    If you open up views/Browse/browse_results_images_html.php (or open up the inspector in your browser), you'll see the styles that are being used on your "places" view.  You'll just need to apply the appropriate styling (or reuse some classes) on your object view to mimic this effect.
  • edited June 2016
    Hi Sophie,

    I guess that's where my confusion is coming from. I pretty much copied over the places view code to the survey objects view. I'm trying to figure out what's causing the difference. I'll check the inspector. 
  • The browse view loads results into rows using bootstrap - you may be missing the mockup that allow your objects results to tile correctly.
  • In fact, your related objects aren't loading into the browse view at all.  You're searching on ca_objects.object_id which will return one result (the record you are on), but the browse results are configured to display only if there's more than one result.  You should try searching on ca_objects.related.object_id.

    The related objects you are seeing in your view are coming from the code a few lines up (that don't employ the browse views or styling).
  • edited June 2016

    I edited this code.

    {{{<ifcount code="ca_objects" min="2">
    <div class="row">
    <div id="browseResultsContainer">
    <?php print caBusyIndicatorIcon($this->request).' '.addslashes(_t('Loading...')); ?>
    </div><!-- end browseResultsContainer -->
    </div><!-- end row -->
    <script type="text/javascript">
    jQuery(document).ready(function() {
    jQuery("#browseResultsContainer").load("<?php print caNavUrl($this->request, '', 'Search', 'objects', array('search' => 'object_id:^ca_objects.related.object_id'), array('dontURLEncodeParameters' => true)); ?>", function() {
    autoTrigger: true,
    loadingHtml: '<?php print caBusyIndicatorIcon($this->request).' '.addslashes(_t('Loading...')); ?>',
    padding: 20,
    nextSelector: 'a.jscroll-next'
    </ifcount>}}} </div><!-- end container -->

    Is that right? Or am I still missing something? 
  • That should work - you probably want to set it to min="1" as well
  • edited July 2016
    So, I've actually taken out the main related objects section. At the moment, I'm getting the loading lashes, but the browse function seems to be taking quite a while. So we'll see if this is actually the optimal thing. 

    Update, the lashes seem to be neverending. 
  • Sorry, try changing the search string to 'search' => 'ca_objects.related.object_id:^ca_objects.object_id'

    You may need to change your search indexing configuration for this to work.
  • Hi Sophie,

    What exactly would I need to change in my search indexing configuration? I did as you suggested, but it doesn't actually give me anything at all. 
  • Sorry to butt in, but, in my installation at least (v 1.6.1), I found that the object_id field wasn't being indexed (for either ca_objects or related objects), so I had to add that to my search_indexing.conf.  Sorry if this is totally unrelated and/or unhelpful.

    Here's how the ca_objects section looks now in my search_indexing.conf.  The stuff I added is in red.  Disclaimer: I only barely know what I'm doing, so this could likely be incorrect.  All I know is that search by object_id is now apparently working whereas it wasn't before.  Oh, and don't forget to reindex if you do end up changing the config.

    ca_objects = {
    fields = {
    _metadata = { }, # forces indexing of all attributes
    source_id = {},
    lot_id = {},
    type_id = { STORE, DONT_TOKENIZE },
    source_id = { STORE, DONT_TOKENIZE },
    hier_object_id = { STORE, DONT_TOKENIZE },
    access = { STORE, DONT_TOKENIZE },
    status = { STORE, DONT_TOKENIZE },
    deleted = { STORE, DONT_TOKENIZE },
    is_deaccessioned = { STORE, DONT_TOKENIZE },
    deaccession_notes = {},
    deaccession_date = {}
    # Index idno's of related objects
    related = {
    fields = {
    object_id = { STORE, DONT_TOKENIZE }
  • Hi Chris,

    That's definitely helpful! I guess my next question is, how exactly do I reindex? 
  • You can reindex the database through Providence's UI by navigating to Manage > Administration > Maintenance > Rebuild Search Indices
  • Ok, that's what I thought. I just wondered if there was another way to do it just for Paw. But I'll do that and then just copy over the database. 
  • You can run the reindex script via the command line or a cron script using caUtils rebuild-search-index.  Documentation is here:
  • Ok, thank you. I might try that, because my webpage keeps freezing in the midst of the reindexing. 
  • Update, after trying to reindex three times through the web application, it has frozen all three times at the same place. Is there a way to check if it continued to work? Alternatively, I'd be happy to use the command line version, and I'm looking at the documentation Maria provided, but I'm not exactly sure I am using the right command for windows.

    My leading line says: 

    PS C:\CollectiveAccessWebsite\support\bin> 

    From here, I tried to type caUtils rebuild-search-index, but that's not a recognized command. Help? 

  • Try php -f caUtils rebuild-search-index
  • edited August 2016
    Ok, now I'm just getting a response that says it can't open the caUtils file. 

  • Try bin/caUtils instead of caUtils
  • PS C:\CollectiveAccessWebsite> php -f bin/caUtils rebuild-search-index
    Could not open input file: bin/caUtils
  • PS C:\CollectiveAccessWebsite> php -f support/bin/caUtils rebuild-search-index

    gets the result: Could not find your CollectiveAccess setup.php file! Please set the COLLECTIVEACCESS_HOME environment variable to the location of your CollectiveAccess Installation, or run this command from a sub-directory of your CollectiveAccess Installation.
  • Go back to C:\CollectiveAccessWebsite\support\bin and run php -f caUtils rebuild-search-index from there...
  • I still get: 

    Could not find your CollectiveAccess setup.php file! Please set the COLLECTIVEACCESS_HOME environment variable to the location of your CollectiveAccess Installation, or run this command from a sub-directory of your CollectiveAccess Installation.
  • Ah, did no see your previous message on page 2. In any case,  you should set COLLECTIVEACCESS_HOME to C:\CollectiveAccessWebsite in your case (google how to do that, depending on your version of Windows), caUtils does not always automagically figure it out as it does on Linux.
  • Thank you, I will do that. 
  • Ok, I've rebuilt the search indeces on the providence side. Do I need to run the script on the pawtucket side also since they're on separate servers, or will it carry over when I update the database? 
  • Hi msjonesking,

    The search indexing for the front and backend are the same - if you've run it on the backend those changes should be reflected on the front-end.  Just make sure the search_indexing.conf files are the same on both sides.
  • Hi Sophie,

    Is that still true if the instances are separated? I mean that they are not nested in the same file structure. The file structure for Providence exists on one server completely apart from the file structure for Pawtucket. 
  • Yes, Pawtucket always reflects the search indexing configuration of the backend.
Sign In or Register to comment.