I'm looking at creating a private number / license plate application and wondered what the best tools were for the search aspect of it.

I would like the search to have the ability to have the letter A show results including the number 4. For example a search for "A4" would show 44, AA, 4A, A4. I would like the ability to be able to set the parameters eg A = 4, L = 1 and so on.

What would you recommend I use?

  • Do you only need to search full number plates? Or do you need results if someone types AS5 but that's only the start of a plates? It's not a particularly easy thing to do.. The easiest way would be to take advantage of contextual filters' "Allow multiple values" and pass all of the possible combinations that way. Nov 10 '17 at 17:11
  • Ideally any combinations. AS5 would also show 81G AS5 for instance. Nov 10 '17 at 18:17
  • For any combination, it goes from really complicated to really really complicated. You could try to use a views hook to alter filters. drupal.stackexchange.com/questions/76651/… . Or you could query the database directly from a custom form with ajax, which is what I would do. api.drupal.org/api/drupal/includes%21database%21database.inc/… Either way, you're going to need to loop through each character of your search string and create an array of search terms. Nov 10 '17 at 18:53
  • If any other experienced devs have ideas, please post. Nov 10 '17 at 19:03
  • This could also be useful for Views. groups.drupal.org/node/82219 Nov 10 '17 at 19:15

Your Answer

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

Browse other questions tagged or ask your own question.