Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Zachary Austin 1 post 21 karma points
    Sep 02, 2009 @ 19:44
    Zachary Austin
    0

    XsltSearch problem - comma added to beginning of search term

    Umbraco 4.0.2, XSLTSearch 2.7, Windows Vista (dev) and Windows Server 2008 (production)

    Hello everyone.

    I'm having a bit of trouble with XSLTsearch.  I have a search field in my site master page such that users can search from any page in the site, which works fine.  After typing in a search term and pressing the search button, users are redirected to Search.aspx where the XSLTSearch macro kicks in and displays the search results.  However, if the user at this point decides to modify his search terms and search again, here's where the problem begins - a comma is prepended to the search term.  Here's an example:

    1) search for "register" using the search box on the top of the page (defined in the master page).  Get results, all is well.

    2) From the results page, modify search to "registration" and click search.  0 results found, search term in search input box is now ",registration".

    3) Click search again, search term is now ",,registration".  later, rinse, repeat.

     

    Can anyone help?  I am tempted to think that my problem is with ASP.NET and not directly with XSLT search because I have had strange problems with form submission behavior since I relocated my <form runat="server" tag to the site master page.

     

    Thanks in advance.

    -Zach

  • Thomas Kahn 602 posts 506 karma points
    Oct 02, 2009 @ 09:17
    Thomas Kahn
    0

    Do you have a demo somewhere?
    Have you done any alterations to the code in XSTL-search?

    /Thomas Kahn

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Oct 02, 2009 @ 11:31
    Douglas Robar
    0

    Grab the updated XSLTsearch 2.8 (it's packaged as a runway module and also available at http://our.umbraco.org/projects/xsltsearch). That version is better suited to umbraco 4's masterpage templates. I think it may also address your issue.

    You should be able to simply replace the xsltsearch.xslt file on your site with the one in the package (no macro param changes). You might want to look at the way the runway templates would be created... there's a slight difference in the use of the <form> tag.

    To verify if it is an XSLTsearch issue or something specific to your form tags, you might install runway on a test site and then install the XSLTsearch Runway Module. If it searches properly there then you've eliminated XSLTsearch as the culprit. And you can compare the templates used in Runway with your own to isolate the cause of the difference.

    Let us know what you find out!

    cheers,
    doug.

  • jacob phillips 130 posts 372 karma points
    Aug 05, 2010 @ 21:53
    jacob phillips
    0

    I had the same problem in version 2.8. The master template I created the search page under is nested within a form tag with action="?" method="post". When I move the form tags to my XSLTSearch based template around the macro call, the problem goes away. I didn't figure out why, but may need to when I submit this to production...

    I see that the the previewField is set with @nodeName. Is that an umbraco alias? I have 1000's of content nodes in my content tree, and it is not returning these articles based on specific one-word searches taken from the articles...where can I look to figure this out? The attributes of my article docType?

     

  • jacob phillips 130 posts 372 karma points
    Aug 07, 2010 @ 22:27
    jacob phillips
    1

    I ended up having to figure out the comma problem anyway. In my case, the template that I was given contained a search box in a master page. The name of the input text box for that search box was "search". The default text input in the XSLT file for XSLTSearch is also called "search". So, after the search button was clicked, one of the empty fields was being pulled in generating a search term like this: (,)<search term>

    with a comma prepending each successive search, even if a new value was entered, until the page was cleared. Easy solution: change the name of the input field in the other form. Harder (I didn't have control over the other input field), alter the XSLTSearch file to use a different name...

     

    Good Luck

  • Stephen 1 post 21 karma points
    Jun 30, 2011 @ 12:37
    Stephen
    0

    I have noticed a similar problem with XSLTSearch v3.0.  It happens on the search results page when the "both" option is selected for searchBoxLocation.  Each time one is submitted, the values in both boxes are combined and comma separated.  I think it must stem from both search boxes having the same name.

  • Greg Mattison 40 posts 60 karma points
    Apr 08, 2013 @ 18:01
    Greg Mattison
    0

    Hello, I have this same problem. Can you please tell me which line in the XSLTSearch xslt file to modify to fix this?

    Here's an example where I searched for "autism" and the results are good.  Then, if you type in anything else, "community living" for example in the search field in the body and click search it says "No matches were found for Search,community living".  So, it's prepending "search," before the new search term, which is should not.  Thanks for your help. 

    http://www.lifeskills-mo.org/search.aspx?search=autism

Please Sign in or register to post replies

Write your reply to:

Draft