Question:
I'm learning to make an application on iOS , backend on parse.com .
I'm trying to search for cars in the database ( uploaded the json file to parse , installed parse cloud ).
Maybe someone has experience? What would the search function look like?
Thanks in advance
Answer:
I did this:
- For each class that needs to be searched, I added the searchTerms field (an array of strings)
- In the beforeSave function of the class, parsed the content and edited the searchTerms array. For example, parsed the name, category into words and updated the array.
- The search query was again parsed into words
- Each word was added to the Parse.Query object in the query.contains("searchTerms", value);