Copied to clipboard

Flag this post as spam?

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


  • Carlos Mosqueda 244 posts 435 karma points
    Sep 26, 2014 @ 23:09
    Carlos Mosqueda
    0

    Checkboxes search won't pull all nodes with those checked items

    Douglas or anyone,

    We are using XSLTsearch and we are passing the query string in with jQuery.  Easy enough.  The issue lies in the actual nodes themselves and XSLTsearch filter TOO much.  

    So we have some nodes that are set up with a document type. The document type has 3 main properties and each property has a checkbox list that the node should be searched on.

    Example below:

    Age Group
     - 7 and Under
     - 8-to-18
     - 19 plus

    Interests
     - People
     - Places
     - Things
     - Pets

    Floor Level
    - 1
    - 2
    - 3

    SO, each node has a series of these checkboxes checked.  The issue is when the results come back, they filter OUT too many of the results and do more or less an exact match for criteria, which is more exclusive. We would like it to be a bit MORE inclusive.  I am telling XSLT Search to search the searchFields="interests,ageGroup"

    Example:

    Node 1 properties are:
    - 3 and Under, 8-to-18
    - People, Places, Things

    Node 2 properties are:
    - 8-to-18, 19-plus
    - People, Places

    Node 3 properties are:
    - 8-to-18, 19-plus
    - People, Places

    It seems that when I pass the query string it does not search correctly.
    So if I search for '3-and-under' AND '19-plus' it does not bring up ANY nodes because no nodes have those 2 criteria checked at the same time. BUT if I do '19-plus' only it brings up all the nodes with that checked.

    I am confused why this is the case. Is this search inclusive? or more exclusive?  I would think that if '3-and-under' AND '19-plus' are checked, it would bring up ALL nodes with all of those checked.  If this is not the case, where in the XSLT search would I need to change this and how?  

    Thanks in advance.

     

    Carlos

     

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Sep 27, 2014 @ 08:58
    Douglas Robar
    1

    Hi, Carlos,

    XSLTsearch does an 'AND' search for all terms. This is appropriate for most situations. Imagine on a typical site someone searches for Flintstone... all pages with that word will appear. If this is, for example, the flintstone.com site many many pages will be returned. The website visitor might then search for Wilma Flintstone and XSLTsearch will return pages that contain both Wilma AND Flintstone, which would be far fewer and more targeted results. Each term searched for must exist with an 'AND' search like this.

    In your case, you want some nodes to be searched with an 'OR' search (if a page contains this value OR this value OR this value). XSLTsearch doesn't do 'OR" searches when there are multiple terms. This behavior can be changed in the code for XSLTsearch but unless you're quite good at XSLT you may find it beyond you. It certainly isn't a trivial change.

    If on the other hand, you're fairly good with Razor and/or C# you'll find ezSearch a much better option. It does just what XSLTsearch does but is written in Razor making it much easier to modify and extend. It's also even faster than XSLTsearch. And... it is a drop-in replacement for XSLTsearch in most cases so transitioning from one to the other should take only a few minutes. Full docs as well. Here's a good overview and an important comment at the bottom you might find helpful as you consider ezSearch: http://www.theoutfield.net/blog/2013/06/simple-umbraco-searching-with-ezsearch

    Hope this helps.

    cheers,
    doug.

  • Carlos Mosqueda 244 posts 435 karma points
    Sep 28, 2014 @ 01:46
    Carlos Mosqueda
    0

    @Doug,

     

    I am a little confused. Wouldn't my search want be an 'AND' since I want to look for nodes that have "3-and-under" and nodes with "19-plus"?  Or do you mean that if the a single node has to have "3-and-under" AND 19-plus" checked in order to be brought back in the search results?  Not 2 different nodes that, one, only has "3-and-under" and another that has "19-plus".  In my case both nodes, one with each property, won't get returned?

     

    Carlos

     

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Sep 28, 2014 @ 18:56
    Douglas Robar
    1

    Hi, Carlos,

    I mean 'AND' in the computer-science/programming language way... a match if found if THIS TERM AND THAT TERM are both present. In your example, any node that has both "3-and-under" AND "19-plus" would match and be displayed by XSLTsearch. XSLTsearch would not display a node that had only one OR the other term present.

    I think the confusion is that you're thinking about the results... you want to see nodes that have "3-and-under" and you also want to see nodes that have "19-plus". In effect, this is the result of two distinct searches... one for "3-and-under" and another for "19-plus". This would be equivalent to doing a single search for any nodes that have "3-and-under" OR "19-plus".

    Hope this helps clarify the behaviour of search engines. They all do it the same way.

    cheers,
    doug.

  • Carlos Mosqueda 244 posts 435 karma points
    Sep 28, 2014 @ 23:06
    Carlos Mosqueda
    0

    Oh. Now I understand. Thank you for the clarification. Very much appreciated.

     

    Carlos

Please Sign in or register to post replies

Write your reply to:

Draft