At the moment, if you turn on OpacSuppression and try to search for records without having at least one record with 942$n = 1 indexed, you'll get zero results back. However, the special Zebra attribute 14 allows you to get around this problem. Attribute 14: "Specifies whether un-indexed fields should be ignored. A zero value (default) throws a diagnostic when an un-indexed field is specified. A non-zero value makes it return 0 hits." (http://www.indexdata.com/zebra/doc/querymodel-zebra.html) Now the description is a bit vague... you can't try something like "@attr 14=1 @attr 1=9999 1" to work. You'll still get a diagnostic error. However, you can try something like "@attr 14=1 @attr 1=9011 1" to work as 9011 is a valid use attribute in bib1.att. Anyway, by adding 14=1 to the Suppress qualifier in ccl.properties, we can make it so that OpacSuppression queries still work even when there are no suppressed records in Zebra. Cool, n'est-ce pas? No... it's not cool, but it's handy.
Unfortunately, I can't currently install the dependencies for master, namely Crypt::GCrypt which despite being marked as not required is required to even visit mainpage.pl, so I'll just be posting something here for someone else to do: -- ccl.properties: Replace: Suppress 1=9011 With: Suppress 1=9011 14=1 -- opac-search.pl: Replace: $query = '@not '.$query.' @attr 1=9011 1'; and $query = '@not '.$query.' @attr 1=9011 1'; #PQF syntax With: $query = '@not '.$query.' @attr 14=1 @attr 1=9011 1'; and $query = '@not '.$query.' @attr 14=1 @attr 1=9011 1'; #PQF syntax -- You'll need to test the opac-search.pl stuff, but I've already tested the ccl.properties change and it works a treat.
Created attachment 44899 [details] [review] Bug 15198 - Make OpacSuppression work even if there are no records suppressed This patch adds the Zebra special attribute 14 to ccl.properties and opac-search.pl, so that we can turn on OpacSuppression and still return results even if there are no records in Zebra for the Suppress index. _TEST PLAN_ Before applying: 1) Make sure that you have no suppressed records indexed in Zebra 2) Turn on OpacSuppression system preference 3) Search using a keyword which should bring up records 4) Note that no records are returned in the results 5) Change UseQueryParser system preference to "Try" 6) Repeat steps 3-4 Apply the patch. After applying: 7) Repeat step 3 (ie search using a keyword which should bring up records) 8) Confirm that records are appearing in the results! 9) Change UseQueryParser system preference to "Do not try" 10) Repeat step 3 11) Confirm that records are appearing in the results!
Created attachment 44901 [details] [review] [SIGNED-OFF]Bug 15198: Make OpacSuppression work even if there are no records suppressed This patch adds the Zebra special attribute 14 to ccl.properties and opac-search.pl, so that we can turn on OpacSuppression and still return results even if there are no records in Zebra for the Suppress index. _TEST PLAN_ Before applying: 1) Make sure that you have no suppressed records indexed in Zebra 2) Turn on OpacSuppression system preference 3) Search using a keyword which should bring up records 4) Note that no records are returned in the results 5) Change UseQueryParser system preference to "Try" 6) Repeat steps 3-4 Apply the patch. After applying: 7) Repeat step 3 (ie search using a keyword which should bring up records) 8) Confirm that records are appearing in the results! 9) Change UseQueryParser system preference to "Do not try" 10) Repeat step 3 11) Confirm that records are appearing in the results! Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised. No more, won't need to have at least one record with the value "1" in the field mapped with this index. All records in OPAC returned.
I think, IMHO, you need to send another patch rewording the syspref OpacSuppression "Hide/Don't hide items marked as suppressed from OPAC search results. Note that you must have the Suppress index set up in Zebra and at least one suppressed biblio record, or your searches will be broken." I also add Documentation Manager
(In reply to Héctor Eduardo Castro Avalos from comment #4) > I think, IMHO, you need to send another patch rewording the syspref > OpacSuppression "Hide/Don't hide items marked as suppressed from OPAC > search results. Note that you must have the Suppress index set up in Zebra > and at least one suppressed biblio record, or your searches will be broken." > > I also add Documentation Manager Yes, excellent point! I was thinking of that earlier today, but I totally forgot by the time I was writing the patch.
I suppose some of the wording might be accurate... "att 9011 Suppress" does need to exist in bib1.att... but that's fairly obvious and it's a default.
I suppose you also have to have Suppress in ccl.properties... but again that's a default.
Created attachment 44902 [details] [review] Bug 15198 - Change wording of OpacSuppression system preference
Marking this back to "Needs Signoff" for the second patch...
Created attachment 44911 [details] [review] [SIGNED-OFF]Bug 15198: Change wording of OpacSuppression system preference Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Paragraph rewording successfully
Very nice catch. I had seen this attribute type and had the same idea once (but then I forgot).
I am sorry, but this isn't working for me. I checked that no 942$n != "" existed in my database. I did a full reindex (-b -v -r). I checked that "de" returned results on master, then turned on OpacSuppression. As expected, the search did not return any results after. Applied patch. Search is still not returning any results. What could be wrong? something I can check? Running my git installation in Ubuntu 14.04 LTS.
... ok, I know what happened... ccl.properties... gah.
(In reply to Katrin Fischer from comment #13) > ... ok, I know what happened... ccl.properties... gah. It'll get you every time. Testing Zebra changes are a bit of a pain...
Created attachment 44971 [details] [review] [PASSED QA] Bug 15198: Make OpacSuppression work even if there are no records suppressed This patch adds the Zebra special attribute 14 to ccl.properties and opac-search.pl, so that we can turn on OpacSuppression and still return results even if there are no records in Zebra for the Suppress index. _TEST PLAN_ Before applying: 1) Make sure that you have no suppressed records indexed in Zebra 2) Turn on OpacSuppression system preference 3) Search using a keyword which should bring up records 4) Note that no records are returned in the results 5) Change UseQueryParser system preference to "Try" 6) Repeat steps 3-4 Apply the patch. After applying: 7) Repeat step 3 (ie search using a keyword which should bring up records) 8) Confirm that records are appearing in the results! 9) Change UseQueryParser system preference to "Do not try" 10) Repeat step 3 11) Confirm that records are appearing in the results! Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Works as advertised. No more, won't need to have at least one record with the value "1" in the field mapped with this index. All records in OPAC returned. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 44972 [details] [review] [PASSED QA] Bug 15198: Change wording of OpacSuppression system preference Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> Paragraph rewording successfully Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Patches pushed to master. Thanks David!
Does this also require an update to the system preference text, now that we don't require there to be one record marked suppressed?
oh my gosh. Reading failure. ignore me.
Pushed to 3.18.13, and released.