---------- Forwarded message ---------- From: Marius Dumitru Florea <mariusdumitru.flo...@xwiki.com> Date: Mon, Sep 15, 2014 at 4:35 PM Subject: Re: [xwiki-users] Solr and blank characters To: Pascal BASTIEN <pbasnews-xw...@yahoo.fr>
On Mon, Sep 15, 2014 at 4:22 PM, Pascal BASTIEN <pbasnews-xw...@yahoo.fr> wrote: > Thxs a lot for this detailled explaination and these links: it helps my tiny > xwiki knowledge. :-) > > If I want looking for a string in all my fields on my EAClass, I must add > all my fields in > set ($solrConfig = { > 'queryFields': 'title^3 > property.Formulaires$20SMQ.EAClass.A_ExpertsAutre > property.Formulaires$20SMQ.EAClass.MyField > property.Formulaires$20SMQ.EAClass.AnotherField > property.Formulaires$20SMQ.EAClass.AnotherOne', > or I can use something like this ? > 'queryFields': 'title^3 property.Formulaires$20SMQ.EAClass.* No, like this: 'queryFields': 'title^3 object.Formulaires$20SMQ.EAClass' See http://design.xwiki.org/xwiki/bin/view/Design/SolrSchema#HDocumentFields . The downside is that the name of the property whose value is matched won't be displayed in the search results (you match the entire object not just a particular property). Hope this helps, Marius > > ________________________________ > De : Marius Dumitru Florea <mariusdumitru.flo...@xwiki.com> > À : Pascal BASTIEN <pbasnews-xw...@yahoo.fr>; XWiki Users <users@xwiki.org> > Envoyé le : Lundi 15 septembre 2014 14h59 > > Objet : Re: [xwiki-users] Solr and blank characters > > Sorry for the late reply. > > On Fri, Sep 5, 2014 at 6:18 PM, Pascal BASTIEN <pbasnews-xw...@yahoo.fr> > wrote: >> Hello, >> I try to writing a search page in my application, but unfortunaly I used >> bank characters in my spave name :-( >> I try to applie this method: >> http://extensions.xwiki.org/xwiki/bin/view/Extension/Solr+Search+Application#HSearchUIConfiguration >> without succes. > >> I tried to replace blank with + character and/or add " character or ' > > No. It doesn't work like this. See > http://design.xwiki.org/xwiki/bin/view/Design/SolrSchema#HEncodingDynamicFieldNames > and > http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki53RC1#HSearchforDocumentsMatchingSpecificValuesinMultipleXObjectProperties > : > > "We're using an encoding scheme similar to the URL-encoding to support > special characters in the Solr index field names" > >> >> The result is an error or no search result... >> >> Have you got a tip to escape blank character in my code? >> >> {{include reference="XWiki.SearchCode"/}} >> >> {{velocity output="false"}} >> #if ($searchEngine == 'solr') >> ## Customize the Solr Search UI for the application. >> #set ($solrConfig = { > >> 'queryFields': 'title^3 >> property.Formulaires+SMQ.EAClass.A_ExpertsAutre', > > 'queryFields': 'title^3 property.Formulaires$20SMQ.EAClass.A_ExpertsAutre', > >> 'facetFields': ['creator', 'creationdate', 'author', 'date', >> 'mimetype', 'attauthor', 'attdate', 'attsize'], >> 'filterQuery': [ >> 'type:DOCUMENT', >> "wiki:$xcontext.database", > >> "space_exact:Formulaires+SMQ", >> 'class:Formulaires+SMQ.EAClass' > > These are different. See > https://wiki.apache.org/solr/SolrQuerySyntax#Default_QParserPlugin:_LuceneQParserPlugin > > "Certain characters are special and those characters need to be > escaped using quotes or a backslash if you want them to be treated as > literals." > > This works for me: > > 'space_exact:"Formulaires SMQ"', > 'class:"Formulaires SMQ.EAClass"' > > Hope this helps (next time :) ), > Marius > > >> ] >> }) >> #end >> {{/velocity}} >> >> {{velocity}} >> {{include reference="$searchPage"/}} >> {{/velocity}} >> >> >> >> >> Thxs >> >> Pascal B > >> _______________________________________________ >> users mailing list >> users@xwiki.org >> http://lists.xwiki.org/mailman/listinfo/users > > > _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users