Ahh, yes, an annoyance of the .ini file format. There’s an (admittedly nasty) hack to work around this, as discussed on the VUFIND-505 ticket:
Since the problem here is that .ini files don't allow certain characters in the key (brackets, braces, etc.), one simple solution is to simply change the [CheckboxFacets] section so that instead of using filter
=> label format, it uses label => filter. I've just added a feature so that if you prefix the name of your checkbox facet section in the SideFacets configuration with a tilde (~), the module reads the configuration in label => filter format instead of filter
=> label format. This allows you to apply any complex checkbox filter you like.
So change CheckboxFacets to ~CheckboxFacets in the recommendation module configuration in searches.ini, then reverse the keys and values in the section.
(And I’m open to better solutions to this problem if anybody has any in mind).
From: Chanel Wheeler [mailto:Chanel.Wheeler@yavapai.us]
Sent: Tuesday, April 30, 2013 1:02 PM
To: vufind-tech (firstname.lastname@example.org)
Subject: Re: [VuFind-Tech] couple of facet questions
1) That govdocs syntax didn’t work. Caused an “Array provided to Escape helper, but flags do not allow recursion” error. Anything with square brackets seems to piss it off.
2) Truthfully, I was trying to piggyback on the date range just to get a proof of concept. What I’m actually doing is creating a range search for Accelerated Reader and Reading Counts levels which are floating
numbers so it was going to require some code departure anyway. Over the river and through the code I go.
From: Demian Katz [mailto:email@example.com]
Sent: Tuesday, April 30, 2013 9:47 AM
To: Chanel Wheeler; vufind-tech (firstname.lastname@example.org)
Subject: RE: couple of facet questions
govdocs:[* TO *]
2.) The [SpecialFacets] stuff is all hard-coded, so you’ll need to build your own. If you follow the configuration keys from the configuration file through the code you should find all the pieces (but let me
know if anything is unclear). It may be possible to generalize this to make it easier to add more – if you have any ideas (or want to discuss strategies), let me know; might be something worth including in a future release.
I created a Government Documents checkbox facet. It indexes 008 byte 28. The intention is that when you check the box only the search results that have a value at 008 will appear (there’s about 10 possible values). I’m not sure how
to structure the entry in facets.ini to get the desired results. I tried:
govdocs:* = "Government Documents"
but that just resulted in an empty result set. (If I replace the * with an “f” it works but I want all govdocs, not just the federal ones.) Various other regexes didn’t work either (I’m guessing as to what may or may not be accepted).
Is the only way to solve this to reindex, evaluate the field, and set the index to something like 1 or 0 so that the facets.ini entry will look like:
govdocs:1 = "Government Documents" ?
Second facet question … I added a couple of new ranges under [SpecialFacets] (fields already indexed but perhaps not correctly). I was expecting some new facet date ranges to appear (cleared cache) but none did. Is it that I did something
wrong in the indexing or is it that I have to implement something more for these new ranges to appear? (Indices definitely exist in records; didn’t get any new values in $dateFacets or $sideFacetSet in SideFacets.phtml.)
Thanks for any pointers,
Library Network Programmer/Analyst
Yavapai Library Network
1120 Commerce Dr.
Prescott, AZ 86305
Phone: (928) 442-5741
Open a help desk ticket