M
M
mbhusty2020-01-09 10:53:42
MODX
mbhusty, 2020-01-09 10:53:42

How to attach simplesearch to your table in MODX?

There are several custom components with their own tables. I'm trying to fasten the search for data in them, and I did not find anything except simplesearch.
Can someone come across connection of search in the tables? The snippet has a parameter &customPackages, but it's not entirely clear how to use it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-01-09
@i__dmitry

The docs directly say what to do:
https://docs.modx.com/current/en/extras/simplesear...
Section "Searching Custom Tables".
Let's break down each part:
className - The class name of the table you want to search. Here, it's QuipComment.
fieldName(s) - A comma-separated list of column names to search. We did 'body', you could also have done 'body,email' or whatever.
packageName - The name of the schema Package to add. This one is called Quip.
packagePath - The path to the model/ directory where the package is located.
joinCriteria - The SQL to join the table you want to search and the modResource table. Your table must have some connection to the Resource it's on (otherwise SimpleSearch won't know how to load a URL for it!)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question