I have a search index of about 15 fields (profile2 fields) build with the search API indexer (mysql) and I need to build an advanced query. All fields are fulltext. The query input form would have about 6 fields:
name, postal code, zip, city, keywords
The complete sql query (pseudo code), conditionally based on what the user entered in the form fields, would look like this
SELECT
*
FROM
{index}
WHERE
(field_last_name = 'name' OR field_first_name = 'name')
AND
field_postal_code = 'zip'
AND
field_city = 'city'
AND
(field_interests = 'keywords' OR field_hobbies = 'keywords' OR ...)
ORDER BY ...
Is this possible at all to build a filter like this?
I try to find a way to build an advanced search and I first tried Views using the filter criteria but I can not build an exposed form like I want. Also as a next step I need to integrate a proximity search on the postal code field. After some reading and hours of using google I thought the search API would give me a go to get a solution on that problem.
To completely understand my problem please refer to this question I asked yesterday: Views 3 Custom filter for Profile2 data
I would really appreciate some hints if I am on the right track or if I have to code a completely distinct module to build that kind of search engine.
Thanks to you all for your help!