i am implementing a search on a site which has a significant amount of content split over several sections:
products
information
literature
news articles
etc
this is all fine, and xslt search does the job perfectly, BUT the results are unmanageable. - Because of their SEO, the client rightly have multiple references to their products in the titles and body text of the news articles and pages, and often the product searches bring a list of non-product results at the top of the list.
There is a specific product search on the site, but owing to the site search form being on every page, users naturally use that.
WHAT I WOULD LIKE TO DO:
i want to split the results into tabs:
product
news
literature
other
in an effort to push product [the goal of the site] while making users with other information requirements able to easily identify the appropriate results for them.
Is this an easy thing to achieve in XSLTSearch? i did consider the possibility of including several XSLT searches with a variety of 'allowed' document types, then, obviously, sorting the tabs out with jquery.
Is this the best way to accomplish this, or should i be looking at edits to the XSLT search itself to order the results and group into tabs?
has anyone else done this? i am sure poeple have, and it would be great to know how you went about it.
To split out the results. You'll just need to be careful about paging - removing paging and using an improbably large page size would be easiest. Once you have the results split out you could just use any of the tab implementations out there (such as jqueryui) to make your interface
this followed dan's suggestion [thanks dan], but was not without issues. i got it all working [with no paging], but for some reason, the tabs were intermittently populated and also, when one of them was returned empty, one of the closing div tags was not written to the page [something i have experienced before].
mulitple search
the 'tabs mark-up' placed in the template allowed me to drop in 3 instances of the search, picking alternate sources for the searches means that i am returning the results as they should be
result count is correct per tab
paging is correct per tab
mark-up is wrong as there are now duplicate 'id', but i should be able to sort that out pretty quickly
the second was definitely easier, and unless anyone has any advice to the contrary, i would recommend this as a quick and dirty solution.
everything seems to run reasonably quickly, though with more pages and so on, it may have performance issues.
once the page design and search/results criteria are sorted out, i will try to see what the difference is in demand, and speed, and then may go back and try to customise the XSLTSearch to add in the tabs in a single call.
I've been constructing something similar with a XSLTSearch. However I've run into a pickle and I was wondering if anyone had any ideas.
Essentially I to am filtering search reasults by @documentTypeAlias to split out 'News' 'Articles' etc. However what I'm trying to create is checkbox list that allows users to pick which of these they would like to see at the same time. Trick is that although I can easily split matched nodes into set's for each area
XSLTSearch
hi all,
i am implementing a search on a site which has a significant amount of content split over several sections:
You'll definitely need to edito xsltsearch to do this, but it should be fairly manageable.
Results are stored in a $matchedNodes variable, so there's nothing stopping you doing several different
To split out the results. You'll just need to be careful about paging - removing paging and using an improbably large page size would be easiest. Once you have the results split out you could just use any of the tab implementations out there (such as jqueryui) to make your interface
Dan
thanks dan.
i'll post an update when i am finished
UPDATE:
i have tried a couple of options:
single search
mulitple search
glad you're getting somewhere!
regarding the empty divs, it's probably that when there are no results your div becomes self-closing (breaking css)
In this case you can change the output method from xml to html but this could break images
So you can put a non-breaking space in your div so that it doesn't close itself
Hope this helps,
Dan
Thanks dan
Hello everyone,
I've been constructing something similar with a XSLTSearch. However I've run into a pickle and I was wondering if anyone had any ideas.
Essentially I to am filtering search reasults by @documentTypeAlias to split out 'News' 'Articles' etc. However what I'm trying to create is checkbox list that allows users to pick which of these they would like to see at the same time. Trick is that although I can easily split matched nodes into set's for each area
I've having trouble selectively combining them. The closest I could fathum is.
Unfortunately the resulting variable cannot be proccessed with xsl:for-each without producing an error.
Any ideas would be welcome as I've had quite the head scratch today on the subject!
Hi DrewJigsaw,
You can process the resulting variable using the node-set extension function:
/Chriztian
is working on a reply...