User:SBachenberg

My Projects:
 * 1) SMW Extension:SolrStore

My Public SSH Key

How to use SolrStore as Remote Autocomplete for Semantic Forms
  Edit your Schema.xml   Add new FieldTypes needed for a good Autocompletetion                                  

 <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.PatternReplaceFilterFactory" pattern="([\.,;:-_])" replacement=" " replace="all"/> <filter class="solr.EdgeNGramFilterFactory" maxGramSize="30" minGramSize="1"/> <filter class="solr.PatternReplaceFilterFactory" pattern="([^\w\d\*æøåÆØÅ ])" replacement="" replace="all"/> <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.PatternReplaceFilterFactory" pattern="([\.,;:-_])" replacement=" " replace="all"/> <filter class="solr.PatternReplaceFilterFactory" pattern="([^\w\d\*æøåÆØÅ ])" replacement="" replace="all"/> <filter class="solr.PatternReplaceFilterFactory" pattern="^(.{30})(.*)?" replacement="$1" replace="all"/> </fieldType>

 <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="1"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.EdgeNGramFilterFactory" maxGramSize="20" minGramSize="1"/> <filter class="solr.PatternReplaceFilterFactory" pattern="([^\w\d\*æøåÆØÅ ])" replacement="" replace="all"/> <charFilter class="solr.MappingCharFilterFactory" mapping="mapping-ISOLatin1Accent.txt"/> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.WordDelimiterFilterFactory" generateWordParts="0" generateNumberParts="0" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0"/> <filter class="solr.LowerCaseFilterFactory"/> <filter class="solr.PatternReplaceFilterFactory" pattern="([^\w\d\*æøåÆØÅ ])" replacement="" replace="all"/> <filter class="solr.PatternReplaceFilterFactory" pattern="^(.{20})(.*)?" replacement="$1" replace="all"/> </fieldType>

 <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory" /> <filter class="solr.TrimFilterFactory" /> <filter class="solr.PatternReplaceFilterFactory" pattern="^(a |the |les |la |le |l'|de la |du |des )" replacement="" replace="all" /> <filter class="solr.PatternReplaceFilterFactory" pattern="([^a-z0-9])" replacement="" replace="all"    /> </fieldType>

 <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </fieldType> </li> <li>Add the Fields needed <field name="person_suggest" type="text_suggest" indexed="true" stored="true"/> <field name="person_suggest_edge" type="text_suggest_edge" indexed="true" stored="true"/> <field name="person_suggest_ngram" type="text_suggest_ngram" indexed="true" stored="true"/> <field name="Person_s" type="text_auto" indexed="true" stored="true" /> The Field we use in our Wiki is called "Person", so the automatically generated field is called "Person_s", because it's a string. We need do define it on our selfs because the auto generated field is multivalued and this doesn't work with multivalued fields! </li> <li> Create CopyFields for your new defined Fields <copyField source="Person_s" dest="person_suggest" /> <copyField source="Person_s" dest="person_suggest_edge" /> <copyField source="Person_s" dest="person_suggest_ngram" /> </li> </ol> </li> <li> Edit your solrconfig.xml <requestHandler name="/suggestPerson" class="solr.SearchHandler"> <str name="echoParams">explicit <str name="defType">edismax 10              Person_s,dbkey,score person_suggest^15 person_suggest_ngram^25.0 person_suggest_edge^25.0 score desc,dbkey asc </requestHandler> </li> <li>Restart your Solr and start a re-index</li> <li>Edit your Semantic Forms Extension</li> <ol><li> go to <your-wiki>/extensions/SemanticForms/includes/ </li> <li> Edit SF_Utils.php line 602 before: after: </li></ol> <li> Edit your LocalSettings.php $sfgAutocompletionURLs['solrPerson'] = "$wgSolrUrl/suggestPerson?q= &wt=json&indent=true&omitHeader=true"; </li> <li> Edit your Form

</li> </ol>