This seems like a common enough scenario that their is probably already a module for it, so I'm asking before I start writing one :).
Given a generic free form text search input on a webpage I would like to have it converted over to a query to be executed against my data. My target is MongoDB like query instructions, but doesn't have to be MongoDB as could easily transform it again.
Something like:
foo and bar
might result in something like:
{
$or: [
{name: /foo and bar/i},
{description: /foo and bar/i},
{$and: [
{name: /foo/i},
{name: /bar/i},
]},
{$and: [
{description: /foo/i},
{description: /bar/i},
]},
...etc...
]
}
Has anyone already done something similar that is out there and easy to include, or is this something that still needs to be created?
Thanks,
- Jeremy