We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14883 ☆ A M B ☆
    • 450 Posts
    I'm using SimpleSearch 1.6.1 (latest) and MODX 2.2.8.

    My call looks like this:
    [[!SimpleSearch?&tpl=`[[+searchResultsContainer:default=`searchresult`]]`&containerTpl=`searchresults`&ids=`[[+site]]`&exclude=`[[*search.exclude]]`]]


    *search.exclude is a comma-separted list of IDs to exclude, as the documentation states.

    It doesn't work, because although the code in /components/simplesearch/model/simplesearch/driver/simplesearchdriverbasic.class.php builds a "NOT IN" clause based on the id values passed in "exclude", those same ids are also in the "IN" clause (because they are child resources on the site I am trying to search).

    I'm not sure whether the fact that the "IN" clause comes *after* the "NOT IN" clause in the query makes a difference - and if it does, I'm not sure how one would go about fixing that order in the xpdo query object. HOWEVER... I'm pretty sure that what *should* be happening here is to *remove* those "exclude" resources from the "IN" clause, rather than building a separate "NOT IN" clause that may conflict.

    Now, how do I go about doing something about this? Do I just fork SimpleSearch in github and submit a pull request?
      • 22303 MODX Staff
      • 10,725 Posts
      You can fork and submit a PR if you know how to fix it. Or just enter an issue for it and we'll take a peek. SimpleSearch is on my list to update soon.
        • 14883 ☆ A M B ☆
        • 450 Posts
        I submitted a pull request of the fix that worked for me. I'm not sure if something similar might need to be done on the 'solr' side of things; I don't know at all how the code on that side works.

        How would I enter an issue for SimpleSearch? In the MODX bug tracker, or in github?

        One feature I'd like to see added is to be able to exclude all of the child resources of those in the "exclude" list. The "idType" parameter defaults to "parents", letting you search all the descendent resources of the ids you list. I'd like the "exclude" ids to be able to work the same way. I'm currently having to pass a getResources call to the "exclude" property as a workaround.
          • 44920
          • 48 Posts
          Hi,

          suffering from the same. how can i get the fixed version please?

          thank you in advance

          my best
          kr
            MODX Revolution 2.2.8-pl (advanced)

            Extras:
            archivist 1.2.4 | Articles 1.7.1 | Babel 2.2.5 | getpage 1.2.3 | getresources 1.6.0 | quip 2.3.3 | SimpleSearch 1.6.1 | taglister 1.1.7 | TinyMCE 4.3.3 | Wayfinder 2.3.3

            PHP Version 5.6.20-0
            MySQL Version 5.5.31