These are chat archives for collectiveaccess/support

16th
Feb 2017
naeemmuhammad
@naeemmuhammad
Feb 16 2017 08:22
@collectiveaccess in our search_indexing.conf in ca_objects block we have '_metadata = { }, # forces indexing of all attributes', which i assumes indexes all metada data elements. If that is the case then i think it is already indexing preferred labels. Or should i include 'preferred_labels.name = {STORE, DONT_INCLUDE_IN_SEARCH_FORM}' in ca_objects block?
Karl Becker
@karbecker
Feb 16 2017 08:36

@collectiveaccess I’ve trried using preg_replace but this doesn’t seem to work with values I get via display templates. Using a simple string the code works, but using curly brackets (thus getting info out of the database) does not:

<?php 
                $ort = "{{{^ca_objects.geonames}}}";
                echo preg_replace('/\[.*/', '', "$ort");
?>

where ^ca_objects.geonames is Regensburg, Deutschland [49.01513,12.10161] [id:2849483] does not work while

<?php 
                $ort = "Regensburg, Deutschland [49.01513,12.10161] [id:2849483] ";
                echo preg_replace('/\[.*/', '', "$ort");
?>

does work.

naeemmuhammad
@naeemmuhammad
Feb 16 2017 09:50

@collectiveaccess Regarding my other question about mulit field search in Pawtucket, as you suggested I made and used an access point as following:
An entry in the search_indexing.conf (in Pawtucket)
ca_objects = {

------------------------------------

_access_points = {
multi_label = {
fields = [ca_object_preferred_labels.name,ca_object_nonpreferred_labels,ca_object_marc210a ],
options = { DONT_INCLUDE_IN_SEARCHFORM },
name =
(multi_label)
},

Subsequently I used the access point in basic search form in Pawtucket:
Multi Title:{{{ca_objects.multi_label%width=100%}}}

It is not working, perhaps i did it wrong, any idea how to make it work?

CollectiveAccess
@collectiveaccess
Feb 16 2017 14:07
Just use "multi_label - no "ca_objects"
@naeemmuhammad Regarding preferred labels, the indexer deals with database tables directly, which means preferred_labels are indexed as entries in a related ca_object_labels table. There should ca_object_labels entries in your search_indexing.conf ?
@kbecker87 Maybe we need to add an option to do this for you. Using Regexes for this sucks. Create a JIRA please? I'm going to try to find time today to do a bunch of requested changes
naeemmuhammad
@naeemmuhammad
Feb 16 2017 14:28

@collectiveaccess Indeed there is ca_object_labels block with below given details, should i include should i include 'preferred_labels.name = {STORE, DONT_INCLUDE_IN_SEARCH_FORM}' in this block?

ca_object_labels = {
    key = object_id,
    fields = {
        name = { BOOST = 100, INDEX_ANCESTORS, INDEX_ANCESTORS_START_AT_LEVEL = 0, INDEX_ANCESTORS_MAX_NUMBER_OF_LEVELS = 4, INDEX_ANCESTORS_AS_PATH_WITH_DELIMITER = . },
        name_sort = { DONT_INCLUDE_IN_SEARCH_FORM }
    },
    # Index names of related objects
    related = {
        fields = {
            name = { BOOST = 100, INDEX_ANCESTORS, INDEX_ANCESTORS_START_AT_LEVEL = 0, INDEX_ANCESTORS_MAX_NUMBER_OF_LEVELS = 4, INDEX_ANCESTORS_AS_PATH_WITH_DELIMITER = . }
        }
    } 
},

CollectiveAccess
@collectiveaccess
Feb 16 2017 14:30
Well it's already indexed, so that's not the problem then
run this search on the back-end:
ca_objects.preferred_labels.name:mars
Do you get correct results or it is too broad?
Karl Becker
@karbecker
Feb 16 2017 19:04
@collectiveaccess Created a JIRA. Thanks!