Search code examples
phpsearchmodxmodx-revolution

MODX SimpleSearch vs. AdvSearch


I planned to implement a search function on my site. I tested both SimpleSearch and AdvSearch.

SimpleSearch was easy to take in use but I was not able to get AdvSearch working in the ajax mode but only in the normal mode. Ajax is not that important so I can use normal pagination. I am still unsure which extra should I use and asking for opinions.

  • Is it possible to search also template variables with SimpleSearch? At least, AdvSearch seems to support that.
  • SimpleSearch seems to be more popular than AdvSearch. AdvSearch has not been updated in 5 years. Would SimpleSearch be a safer choice?
  • Any other recommendations?

Solution

  • Several times when choosing between these two, I leaned in favor of SimpleSearch snippet. Yes, you're right SimpleSearch doesn't support TV search basically (previously there was search driver support as snippet parameter - now you can specify your own search driver with TV search option via System Settings (please see attached screenshot) ). As for me I've just moved all necessary data to basic resource fields where SimpleSearch works perfectly.

    enter image description here

    However, you may encounter other limitations with it, such as performance issues if you use it on a site with hundreds of pages. My option was this - I made a custom snippet, did some of the work (f.e I prepared a list of resources where to search and passed it to the id parameter, this list in my case had to be calculated non-trivially), and then I called it through runSnippet