I'm trying to create job alerts. So every user will select certain filter criteria on their account, which will then be used to perform a search api query returning the relevant new jobs.

To my inexperienced programmer brain this sounds like a lot of queries that will scale terribly.

So I'm trying to construct something which will organise the users into groups who have the same criteria thus avoiding repetition of queries.

(i.e. divide a set of entities into groups based on field values).

My question is, is there a function or commonly used set of procedures for doing this? (Perhaps a module which I could look to for the design?)

Or another option, would the performance change be minimal, because of things like memcache and APC which would cache the queries which repeated?

My current design

In order to do this, my current thinking revolves around creating a branching set of queries.

First divide users by field a options, then divide each sub option into field b options and so on.

Each time you'd check to see if you ended up with 0 or 1 users in which case you could stop the tree.

Because I already use SearchAPI and have indexes running for users and nodes I would use this to query. (I'm assuming it would be faster than pulling from the database).

  • I've just discovered the Search API Saved Searches Module. Although it doesn't answer the question, it does solve my end purpose of creating an efficient way to update people with new results. When I've implemented it I'll possibly post that as an answer. Mar 20 '14 at 17:21

As it turns out implementing the Search API Saved Searches modules is pretty much as easy as turning it on and it works great... No great insights here, just an excellent module.

It allows you to save searches with full facet information (i.e. filter search with 4 different facets and then save that.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.