CivicStack / civicstack

A repository for open source civic tools from many countries and organizations
Other
37 stars 6 forks source link

Server side filtering #19

Closed jfresco closed 8 years ago

jfresco commented 8 years ago
jfresco commented 8 years ago

I implemented MongoDB's text search as explained here, but testing it I've found that it only matches full words. I mean, if I search for dem it will not match democracy. I digged in SO and I've found that the only way to match partial words is by using regex. I noticed you're using MongoDB's $text in DemocracyOS so I assume you're getting the same behavior.

Is it acceptable or should we go for a regex based solution?

mjlescano commented 8 years ago

Nice catch!

Regex FTW. I don't think performance will be an issue keeping in mind the amount of possible projects. 2000 projects would be A LOT, and thats very few for a regex search on mongo.