From: Eoghan Ó C. <eog...@gm...> - 2009-09-18 10:24:04
|
Hi,I just got Till's patch to work in a pre-json revision (r1349) with the following modifications: *web/xsl/solr-convert.xsl:* <ResultSet> <RecordCount><xsl:value-of select="//result/@numFound"/></RecordCount> <xsl:call-template name="facet"/> <xsl:call-template name="doc"/> <xsl:call-template name="similar"/> <!-- Get spellcheck collation if it exists:--> <collation><xsl:value-of select="//str[@name='collation']"/></collation> </ResultSet> *web/services/search/Results.php:* if (!isset($result['record']) && $result['RecordCount'] < 1) { // No record found $interface->assign('newPhrase', $result['collation']); $interface->setTemplate('list-none.tpl'); All other changes, reindexing, and call to Solr URL as per Till's instructions Eoghan 2009/9/18 Eoghan Ó Carragáin <eog...@gm...> > Hi Till,This patch worked for me. Thanks! > Eoghan > > 2009/9/17 Tuan Nguyen <tu...@yo...> > > The buildOnOptimize option is only available in solr 1.4 if I remember >> correctly. >> >> What we've done is to have a nightly cron job to do a wget to solr/ >> biblio/select/?q=*:*&spellcheck=true&spellcheck.build=true >> >> This rebuilds the spellcheck index nightly after we do the nightly add/ >> update/delete cron. >> >> >> >> On Sep 17, 2009, at 4:09 PM, Till Kinstler wrote: >> >> > I just played around a little to get the spellchecker working again >> > in the trunk. The trivial patch attached (for r1489) made it work >> > after reindexing data and manually creating the spellchecking index >> > by calling the URL >> > http://[Solr-server]:[Solr-Port]/solr/biblio/select/? >> > q=allfields:buntebank&spellcheck=true&spellcheck.build=true >> > (though doing an index optimization should (re-)create that index as >> > well). >> > Please test (you need to reindex data) and put into trunk if working >> > reliably. >> > Crucial point is the creation of the spellchecking index in Solr. It >> > took me some trial and error to get it created. Solr isn't telling >> > much about success or failure when calling the URL above. Finally it >> > worked with the settings in schema.xml and solrconfig.xml included >> > in the patch. >> > We should get creation of the spellchecking index somehow into the >> > usual indexing process. One way might be setting the buildOnCommit >> > option in solrconfig.xml, but that slows down commits (and I am not >> > sure, if it really works as expected...). Or simply add a call of >> > the URL above to import-marc.sh and .bat (how to call an URL in >> > a .bat file?)? Or is that a thing to put into solrmarc? There is >> > already an option to call a commit after indexing in solrmarc, so >> > maybe add one to create a spellchecking index as well? If that's the >> > wanted solution, I'll take that over to the solrmarc list and >> > implement it there (but not before October then). >> > >> > Till >> > === modified file 'solr/biblio/conf/schema.xml' >> > --- old/solr/biblio/conf/schema.xml 2009-07-16 18:17:05 +0000 >> > +++ new/solr/biblio/conf/schema.xml 2009-09-17 19:16:16 +0000 >> > @@ -65,7 +65,7 @@ >> > <field name="fullrecord" type="string" indexed="false" >> > stored="true"/> >> > <field name="marc_error" type="string" indexed="false" >> > stored="true"/> >> > <field name="allfields" type="text" indexed="true" stored="false"/> >> > - <field name="spelling" type="textSpell" indexed="false" >> > stored="true"/> >> > + <field name="spelling" type="textSpell" indexed="true" >> > stored="true"/> >> > <!-- Institutional Fields --> >> > <field name="institution" type="string" indexed="true" >> > stored="true" multiValued="true"/> >> > <field name="collection" type="string" indexed="true" >> > stored="true" multiValued="true"/> >> > >> > === modified file 'solr/biblio/conf/solrconfig.xml' >> > --- old/solr/biblio/conf/solrconfig.xml 2009-08-17 15:39:37 +0000 >> > +++ new/solr/biblio/conf/solrconfig.xml 2009-09-17 19:25:01 +0000 >> > @@ -543,9 +543,9 @@ >> > <str name="field">spelling</str> >> > <!--<str name="accuracy">0.7</str> --> >> > <str name="spellcheckIndexDir">./spellchecker</str> >> > + <str name="buildOnOptimize">true</str> >> > </lst> >> > <str name="queryAnalyzerFieldType">textSpell</str> >> > - <str name="buildOnCommit">true</str> >> > </searchComponent> >> > <queryConverter name="queryConverter" >> > class="org.apache.solr.spelling.SpellingQueryConverter"/> >> > >> > >> > === modified file 'web/services/Search/Results.php' >> > --- old/web/services/Search/Results.php 2009-09-16 17:11:42 +0000 >> > +++ new/web/services/Search/Results.php 2009-09-17 19:58:24 +0000 >> > @@ -250,6 +250,10 @@ >> > >> > if ($result['response']['numFound'] < 1) { >> > // No record found >> > + if(isset($result['spellcheck']['suggestions'][1])) { >> > + $collation = array_pop($result['spellcheck'] >> > ['suggestions']); >> > + $interface->assign('newPhrase', $collation[1]); >> > + } >> > $interface->setTemplate('list-none.tpl'); >> > >> > // Save no records found stat >> > >> > >> ------------------------------------------------------------------------------ >> > Come build with us! The BlackBerry® Developer Conference in SF, CA >> > is the only developer event you need to attend this year. Jumpstart >> > your >> > developing skills, take BlackBerry mobile applications to market and >> > stay >> > ahead of the curve. Join us from November 9-12, 2009. Register >> > now! >> > >> http://p.sf.net/sfu/devconf_______________________________________________ >> > Vufind-tech mailing list >> > Vuf...@li... >> > https://lists.sourceforge.net/lists/listinfo/vufind-tech >> >> >> >> ------------------------------------------------------------------------------ >> Come build with us! The BlackBerry® Developer Conference in SF, CA >> is the only developer event you need to attend this year. Jumpstart your >> developing skills, take BlackBerry mobile applications to market and stay >> ahead of the curve. Join us from November 9-12, 2009. Register >> now! >> http://p.sf.net/sfu/devconf >> _______________________________________________ >> Vufind-tech mailing list >> Vuf...@li... >> https://lists.sourceforge.net/lists/listinfo/vufind-tech >> > > |