[xwiki-users] Solr and blank characters
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... without succes. I tried to replace blank with + character and/or add " character or ' 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', 'facetFields': ['creator', 'creationdate', 'author', 'date', 'mimetype', 'attauthor', 'attdate', 'attsize'], 'filterQuery': [ 'type:DOCUMENT', "wiki:$xcontext.database", "space_exact:Formulaires+SMQ", 'class:Formulaires+SMQ.EAClass' ] }) #end {{/velocity}} {{velocity}} {{include reference="$searchPage"/}} {{/velocity}} Thxs Pascal B
Hello, For information, I removed blank character in my space name but my search page doesn't working either. Fortunely I managed to identify the problem: solr search only in english pages of my space... If my wiki is in french, debug of my search page return no results (my pages are in french version): Query Parser ExtendedDismaxQParser Parsed Query +((title_en:super | title__:super)^3.0 | (property.FormSMQ.EAClass.A_ExpertsAutre_string:super | property.FormSMQ.EAClass.A_ExpertsAutre_en:super | property.FormSMQ.EAClass.A_ExpertsAutre__:super | property.FormSMQ.EAClass.A_ExpertsAutre_boolean:F)) Filter Queries * type:DOCUMENT * wiki:xwiki * space_exact:FormSMQ * class:FormSMQ.EAClass If my wiki is in english and if I create some english pages, my search page return correctly results (pages in english version). (FAQ application working well because pages are in english version) Do you think it is a bug? ThxS Pascal BASTIEN ________________________________ De : Pascal BASTIEN <pbasnews-xwiki@yahoo.fr> À : XWiki Users <users@xwiki.org> Envoyé le : Vendredi 5 septembre 2014 17h18 Objet : Solr and blank characters 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... without succes. I tried to replace blank with + character and/or add " character or ' 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', 'facetFields': ['creator', 'creationdate', 'author', 'date', 'mimetype', 'attauthor', 'attdate', 'attsize'], 'filterQuery': [ 'type:DOCUMENT', "wiki:$xcontext.database", "space_exact:Formulaires+SMQ", 'class:Formulaires+SMQ.EAClass' ] }) #end {{/velocity}} {{velocity}} {{include reference="$searchPage"/}} {{/velocity}} Thxs Pascal B
Hi Pascal. I've got the same problem with FAQ application. The search returns inexplicably only some results(or nothing at all). E.g. If I try to search for "test", it finds the following articles: Test 1 Test 7 Test 8 ... Some pages simply don't appear(test 2,3,4,5,...). I cant figure out why. Workarround(maybe it can be usefull to you): - Edit the page where is the html form and set to: <form method="GET" action="$xwiki.getURL('Main.Search')?r=1"> - Insert a hidden field with the value as your FAQ Space name(in my case its the default ["FAQ"]): <input type="hidden" name="f_space_exact" value="FAQ" /> - Done. It will use the default search from XWiki, but will return only itens from FAQ Space. Another interesting I've added is the Auto suggest feature, which is something great for FAQ applications. http://platform.xwiki.org/xwiki/bin/view/DevGuide/AutoSuggestWidget See if it helps you. Regards. http://xwiki.475771.n2.nabble.com/Search-not-working-in-FAQ-Extension-td7591... 2014-09-10 5:52 GMT-03:00 Pascal BASTIEN <pbasnews-xwiki@yahoo.fr>:
Hello,
For information, I removed blank character in my space name but my search page doesn't working either.
Fortunely I managed to identify the problem: solr search only in english pages of my space...
If my wiki is in french, debug of my search page return no results (my pages are in french version): Query Parser ExtendedDismaxQParser Parsed Query +((title_en:super | title__:super)^3.0 | (property.FormSMQ.EAClass.A_ExpertsAutre_string:super | property.FormSMQ.EAClass.A_ExpertsAutre_en:super | property.FormSMQ.EAClass.A_ExpertsAutre__:super | property.FormSMQ.EAClass.A_ExpertsAutre_boolean:F)) Filter Queries * type:DOCUMENT * wiki:xwiki * space_exact:FormSMQ * class:FormSMQ.EAClass If my wiki is in english and if I create some english pages, my search page return correctly results (pages in english version). (FAQ application working well because pages are in english version)
Do you think it is a bug?
ThxS
Pascal BASTIEN
________________________________ De : Pascal BASTIEN <pbasnews-xwiki@yahoo.fr> À : XWiki Users <users@xwiki.org> Envoyé le : Vendredi 5 septembre 2014 17h18 Objet : Solr and blank characters
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... without succes. I tried to replace blank with + character and/or add " character or '
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', 'facetFields': ['creator', 'creationdate', 'author', 'date', 'mimetype', 'attauthor', 'attdate', 'attsize'], 'filterQuery': [ 'type:DOCUMENT', "wiki:$xcontext.database", "space_exact:Formulaires+SMQ", 'class:Formulaires+SMQ.EAClass' ] }) #end {{/velocity}}
{{velocity}} {{include reference="$searchPage"/}} {{/velocity}}
Thxs
Pascal B _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
I shaked a little bit localization parameter, and now my search page working better (found french pages) :-) Query Parser ExtendedDismaxQParser Parsed Query +((title_fr:genial | title__:genial)^3.0 | (property.FormSMQ.EAClass.A_ExpertsAutre_string:genial | property.FormSMQ.EAClass.A_ExpertsAutre__:genial | property.FormSMQ.EAClass.A_ExpertsAutre_fr:genial | property.FormSMQ.EAClass.A_ExpertsAutre_boolean:F)) Filter Queries * type:DOCUMENT * wiki:xwiki * space_exact:FormSMQ * class:FormSMQ.EAClass Pascal the chatty box:-/ ________________________________ De : Pascal BASTIEN <pbasnews-xwiki@yahoo.fr> À : XWiki Users <users@xwiki.org> Envoyé le : Mercredi 10 septembre 2014 10h52 Objet : Re: Solr and blank characters Hello, For information, I removed blank character in my space name but my search page doesn't working either. Fortunely I managed to identify the problem: solr search only in english pages of my space... If my wiki is in french, debug of my search page return no results (my pages are in french version): Query Parser ExtendedDismaxQParser Parsed Query +((title_en:super | title__:super)^3.0 | (property.FormSMQ.EAClass.A_ExpertsAutre_string:super | property.FormSMQ.EAClass.A_ExpertsAutre_en:super | property.FormSMQ.EAClass.A_ExpertsAutre__:super | property.FormSMQ.EAClass.A_ExpertsAutre_boolean:F)) Filter Queries * type:DOCUMENT * wiki:xwiki * space_exact:FormSMQ * class:FormSMQ.EAClass If my wiki is in english and if I create some english pages, my search page return correctly results (pages in english version). (FAQ application working well because pages are in english version) Do you think it is a bug? ThxS Pascal BASTIEN ________________________________ De : Pascal BASTIEN <pbasnews-xwiki@yahoo.fr> À : XWiki Users <users@xwiki.org> Envoyé le : Vendredi 5 septembre 2014 17h18 Objet : Solr and blank characters 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... without succes. I tried to replace blank with + character and/or add " character or ' 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', 'facetFields': ['creator', 'creationdate', 'author', 'date', 'mimetype', 'attauthor', 'attdate', 'attsize'], 'filterQuery': [ 'type:DOCUMENT', "wiki:$xcontext.database", "space_exact:Formulaires+SMQ", 'class:Formulaires+SMQ.EAClass' ] }) #end {{/velocity}} {{velocity}} {{include reference="$searchPage"/}} {{/velocity}} Thxs Pascal B
It seem than there are some problems when your wiki is in multilingual mode (in global preference/localisation). For your problem, you can check the langage of Test2,3,4. It must be a different langage of Test1,7,8 Your workaround is smart (I didn't think about it). Anyway I resolve my problem. Autosuggest seem interessant, I will certainly try it later. Thxs ________________________________ De : Leonardo Kodato <leonardokodato@gmail.com> À : XWiki Users <users@xwiki.org> Envoyé le : Mercredi 10 septembre 2014 14h17 Objet : Re: [xwiki-users] Solr and blank characters Hi Pascal. I've got the same problem with FAQ application. The search returns inexplicably only some results(or nothing at all). E.g. If I try to search for "test", it finds the following articles: Test 1 Test 7 Test 8 ... Some pages simply don't appear(test 2,3,4,5,...). I cant figure out why. Workarround(maybe it can be usefull to you): - Edit the page where is the html form and set to: <form method="GET" action="$xwiki.getURL('Main.Search')?r=1"> - Insert a hidden field with the value as your FAQ Space name(in my case its the default ["FAQ"]): <input type="hidden" name="f_space_exact" value="FAQ" /> - Done. It will use the default search from XWiki, but will return only itens from FAQ Space. Another interesting I've added is the Auto suggest feature, which is something great for FAQ applications. http://platform.xwiki.org/xwiki/bin/view/DevGuide/AutoSuggestWidget See if it helps you. Regards. http://xwiki.475771.n2.nabble.com/Search-not-working-in-FAQ-Extension-td7591... 2014-09-10 5:52 GMT-03:00 Pascal BASTIEN <pbasnews-xwiki@yahoo.fr>:
Hello,
For information, I removed blank character in my space name but my search page doesn't working either.
Fortunely I managed to identify the problem: solr search only in english pages of my space...
If my wiki is in french, debug of my search page return no results (my pages are in french version): Query Parser ExtendedDismaxQParser Parsed Query +((title_en:super | title__:super)^3.0 | (property.FormSMQ.EAClass.A_ExpertsAutre_string:super | property.FormSMQ.EAClass.A_ExpertsAutre_en:super | property.FormSMQ.EAClass.A_ExpertsAutre__:super | property.FormSMQ.EAClass.A_ExpertsAutre_boolean:F)) Filter Queries * type:DOCUMENT * wiki:xwiki * space_exact:FormSMQ * class:FormSMQ.EAClass If my wiki is in english and if I create some english pages, my search page return correctly results (pages in english version). (FAQ application working well because pages are in english version)
Do you think it is a bug?
ThxS
Pascal BASTIEN
________________________________ De : Pascal BASTIEN <pbasnews-xwiki@yahoo.fr> À : XWiki Users <users@xwiki.org> Envoyé le : Vendredi 5 septembre 2014 17h18 Objet : Solr and blank characters
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... without succes. I tried to replace blank with + character and/or add " character or '
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', 'facetFields': ['creator', 'creationdate', 'author', 'date', 'mimetype', 'attauthor', 'attdate', 'attsize'], 'filterQuery': [ 'type:DOCUMENT', "wiki:$xcontext.database", "space_exact:Formulaires+SMQ", 'class:Formulaires+SMQ.EAClass' ] }) #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
Sorry for the late reply. On Fri, Sep 5, 2014 at 6:18 PM, Pascal BASTIEN <pbasnews-xwiki@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... 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#HEncodingDynamicFie... and http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki53RC1#HSea... : "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:_LuceneQP... "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
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.* ________________________________ De : Marius Dumitru Florea <mariusdumitru.florea@xwiki.com> À : Pascal BASTIEN <pbasnews-xwiki@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-xwiki@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... 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#HEncodingDynamicFie... and http://www.xwiki.org/xwiki/bin/view/ReleaseNotes/ReleaseNotesXWiki53RC1#HSea... : "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:_LuceneQP... "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
participants (3)
-
Leonardo Kodato -
Marius Dumitru Florea -
Pascal BASTIEN