{"id":138,"date":"2006-02-25T22:06:28","date_gmt":"2006-02-26T03:06:28","guid":{"rendered":"http:\/\/crschmidt.net\/blog\/?p=138"},"modified":"2006-02-25T22:06:28","modified_gmt":"2006-02-26T03:06:28","slug":"improving-searching-in-openguides","status":"publish","type":"post","link":"https:\/\/crschmidt.net\/blog\/archives\/138\/improving-searching-in-openguides\/","title":{"rendered":"Improving Searching in OpenGuides"},"content":{"rendered":"<p>Per a request on the Milton Keynes guide, I took up the matter of looking at making searches include more than just the text of the entry, but instead also listing the metadata in the nodes. I successfully completed this in the following manner:                                                                                                                                <\/p>\n<p> * Modify the rename.pl in the dist to be more along the lines of:                                                                                                    http:\/\/crschmidt.net\/openguides\/reindex.pl<br \/>\n   You can see here that this indexes phone address city postcode                                                                                                      website fax summary, as well as categories and locales.<br \/>\n * Tested this to make sure the results worked. Number searching seems broken, but other than that it&#8217;s in good shape.<br \/>\n * Head in to try and make this change to the underlying guide code.<br \/>\n * Realize that searching is basically hardcoded into write\\_node, with no easy way around it. Resign self to this fact and decide that                                                                                                        double-indexing is the way to proceed.<br \/>\n * Write a CGI::Wiki Plugin. Bang head against wall until realizing you                                                                                                need to set @ISA yourself.<br \/>\n * Write reindexer similar to reindex.pl above.<br \/>\n * Find &#8220;write_node&#8221; in Openguides.pm. Place Reindexer plugin above                                                                                                    write\\_node (see code snippet at end of email).<br \/>\n * Test it out. Seems to work okay.<br \/>\n * Upload Indexer.pm code to http:\/\/crschmidt.net\/openguides\/Indexer.pm<br \/>\n * Post to mailing list.                                                                                                                                               <\/p>\n<p>I&#8217;m not sure if anyone else will find this interesting, but I certainly did, so I figured I&#8217;d share the knowledge in case anyone else out there wants it.                                                                                                                                                              <\/p>\n<p>  my $indexer = CGI::Wiki::Plugin::Indexer->new;<br \/>\n  $wiki->register_plugin( plugin => $indexer );<br \/>\n  $indexer->reindex($node, $content, \\%metadata);<br \/>\n  my $written = $wiki->write\\_node($node, $content, $checksum, \\%metadata );                                                                                            <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Per a request on the Milton Keynes guide, I took up the matter of looking at making searches include more than just the text of the entry, but instead also listing the metadata in the nodes. I successfully completed this in the following manner: * Modify the rename.pl in the dist to be more along [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[],"class_list":["post-138","post","type-post","status-publish","format-standard","hentry","category-email-posts"],"_links":{"self":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/comments?post=138"}],"version-history":[{"count":0,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/138\/revisions"}],"wp:attachment":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/media?parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/categories?post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/tags?post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}