Islandora Solr Views with inactive objects

108 views
Skip to first unread message

Simon Mai

unread,
Sep 25, 2015, 3:30:37 PM9/25/15
to islandora-dev
Hi all,
I'm trying to create a view that display object info (title, thumbnail, collection, ...) of inactive objects. 
But it seems like setting the state of an object to 'Inactive' or 'Deleted' will make it unavailable to Solr, and then I have no results for my view (The same view works fine for "active" objects)
Is there any way to do that for "inactive" objects?
Thanks !
Simon

Simon Mai

unread,
Sep 25, 2015, 3:35:35 PM9/25/15
to islandora-dev
I'm using Islandora Solr Views 7.x-1.4

Jared Whiklo

unread,
Sep 25, 2015, 3:58:14 PM9/25/15
to island...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Is there a way, yes. Should you do it? I'd probably say no.

You could modify the GSearch configuration to not remove items from
the search index if they are marked inactive. Deleted is a whole other
problem, so I'll stick with inactive.

You'll probably want to extend alter this xsl:when statement[1] and
allow for Inactive, you probably don't want deleted.

But you then you have to pull those out of your search so people don't
start to get results with those inactive items displayed.

So in the Islandora Solr Settings, there is a Solr base filter. You
might have to play with it but which ever field you index as the item
state then you want
- -<that field>:Inactive

Also you probably want to confirm that the state is Inactive.

So not having actually done this, this is how I would do it, but I'm
still not sure you should.

cheers,
jared

[1]
https://github.com/discoverygarden/basic-solr-config/blob/modular/foxmlT
oSolr.xslt#L125
> -- You received this message because you are subscribed to the
> Google Groups "islandora-dev" group. To unsubscribe from this group
> and stop receiving emails from it, send an email to
> islandora-de...@googlegroups.com
> <mailto:islandora-de...@googlegroups.com>. To view this
> discussion on the web visit
> https://groups.google.com/d/msgid/islandora-dev/80403a01-c133-4155-9f2
4-e0cd65b6825d%40googlegroups.com
>
>
<https://groups.google.com/d/msgid/islandora-dev/80403a01-c133-4155-9f24
- -e0cd65b6825d%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

- --
Jared Whiklo
jwh...@gmail.com
- --------------------------------------------------
I've learned that no matter how much I care, some people are just
jackasses.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)

iEYEARECAAYFAlYFp1QACgkQqhIY384dF1bGpgCfd1/XLWPkFzaGGUGF/U0+xVI9
CYMAoK3Kshl/gAD3JpAJ4q4KqCmlz7qi
=pcnj
-----END PGP SIGNATURE-----

Diego Pino

unread,
Sep 25, 2015, 4:08:23 PM9/25/15
to islandora-dev
Hi Simon, inactive objects trigger unindexFedoraObject template in foxmltosolr.xslt (gsearch), removing them from Solr.
If you really need inactive objects in the Solr Index, then you will have to modify foxmltosolr.xslt. Should not be difficult, you could replace this line (please check syntax/test…not 100% sure)
 <xsl:when test="foxml:digitalObject/foxml:objectProperties/foxml:property[@NAME='info:fedora/fedora-system:def/model#state' and @VALUE='Active']">
for 
 <xsl:when test="foxml:digitalObject/foxml:objectProperties/foxml:property[@NAME='info:fedora/fedora-system:def/model#state' and (@VALUE='Active' or @VALUE='Inactive')]">

This will keep your inactive objects in Solr. Now you will have to index the "state" also as an Solr document field (if not already present) to be able to filter those from normal searches.

Best

Simon Mai

unread,
Sep 28, 2015, 9:04:26 AM9/28/15
to islandora-dev
Thanks for quick reply, but I don't want to change the Gsearch configuration.
Do we have another way to only alter a function of Islandora Solr Views module to be able to view all objects (both "active" and "inactive" ones) <== I wish Islandora Solr Views would work this way.
For example, with Islandora Simple Workflow, we can set up a group permission as "Manage inactive objects" and then we can view and manage a list of inactive objects. 
Simon.

Simon Mai

unread,
Sep 28, 2015, 9:31:53 AM9/28/15
to islandora-dev
I'm trying to alter this class: /islandora_solr_search/includes/query_processor.inc:class IslandoraSolrQueryProcessor { .... }

Simon Mai

unread,
Sep 28, 2015, 9:54:15 AM9/28/15
to islandora-dev
Oh, I see. 
The Islandora Simpel Workflow works directly with Fedora data through Tuque API, while Islandora Solr Views uses to SOLR query.
So is it impossible to alter the Islandora Solr Search/Islandora Solr Views to view "inactive" objects, right?
The only way is modifying the GSearch configuration to not remove items from the search index if they are marked inactive. 
Yah, right, probably I'd say "no" to change this. Humh, maybe using Tuque is another way to do it then.
Simon.
 

Simon Mai

unread,
Sep 28, 2015, 1:15:49 PM9/28/15
to islandora-dev
I found a solution to get data from "inactive" objects.
Using "islandora_object_load($pid)" solved my problem. 
Anyway, thank you so much for helping me to know more about SOLR searching.
Simon.

Reply all
Reply to author
Forward
0 new messages