Filter/Search by Region or Category; Wildcard characters

14 views
Skip to first unread message

sam

unread,
Nov 19, 2009, 2:24:12 PM11/19/09
to Social Actions Developers
Hi all!

Myself and some other folks here in SF are doing some work with the SE-
API and we have a few questions.

To start with, we're wondering about filtering search results. We
would like to provide a facility for folks to filter search results by
issue & region. In the API docs (http://socialactions.pbworks.com/
Social+Entrepreneur+API+-+Documentation) it looks like the only
request parameters are: q, created, sites, limit, order, and
just_stats -- no issue / region request parameter.

Christine previously mentioned on this group:

We hope to add more features (to search by category, target
population, issue area, etc.) to search.socialentrepreneurapi.org
soon.

(from http://bit.ly/xdh8R)

-Is there a good way to currently filter results by issue/region using
the API? If not, I'm thinking that we'll need to do a search with a
very large (larger then # of records in dataset) limit, and then
filter out the results ourselves.

Does this seem like a reasonable solution for doing this filtering now
(before it's added into the API)? Does anyone have a better
suggestion for a better way to implement this filtering and/or is the
filtering on the short-term road map?

Here's an example of one such query:

http://search.socialentrepreneurapi.org/entrepreneurs.json?q=water?limit=100000

-Also, is there a wildcard character that we could use in the query
string to use RegEx?

More questions likely to come from us soon -- sorry in advance if we
fill up any inboxes :) Feel free to pre-filter us right to your junk
folder :)

Thanks!

Jason Mott

unread,
Nov 19, 2009, 3:44:11 PM11/19/09
to social-ac...@googlegroups.com
Hi Sam,

I will be addressing your questions (and perhaps tweaking the system as
needed) soon. Unfortunately, I may not be able to make time until at
least Monday. I will attempt to make at least time to answer questions
tomorrow.
> --
>
> You received this message because you are subscribed to the Google Groups "Social Actions Developers" group.
> To post to this group, send email to social-ac...@googlegroups.com.
> To unsubscribe from this group, send email to social-actions-...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/social-actions-dev?hl=.
>
>
>

--
Jason Mott
Worker-Owner
Software Engineer

Ronin Tech Collective, Inc.
167 Main St. Suite 103
Brattleboro, VT 05301
888.200.5074 x369
http://www.ronincollective.com

Peter Deitz

unread,
Nov 20, 2009, 1:28:27 PM11/20/09
to social-ac...@googlegroups.com
Hi Sam,

More coming from Jason in the coming days, but yes, there are parameters
for searching region, issue area, and target population. The
documentation may not yet reflect these features, and Jason may have to
make some adjustments on the Ruby side to activate these features.
Thanks for your patience.

Regarding RegEx, I have no idea.

All the best,
Peter

sam

unread,
Nov 20, 2009, 4:25:37 PM11/20/09
to Social Actions Developers
Hi Peter and Jason,

Thanks for your responses.

Any chance that there is access to a staging server just so I can get
some idea of what to expect once these features are added to the
current API?

I appreciate all the hard work.

-Sam Choi
> >> (fromhttp://bit.ly/xdh8R)
>
> >> -Is there a good way to currently filter results by issue/region using
> >> the API?  If not, I'm thinking that we'll need to do a search with a
> >> very large (larger then # of records in dataset) limit, and then
> >> filter out the results ourselves.
>
> >> Does this seem like a reasonable solution for doing this filtering now
> >> (before it's added into the API)?  Does anyone have a better
> >> suggestion for a better way to implement this filtering and/or is the
> >> filtering on the short-term road map?
>
> >> Here's an example of one such query:
>
> >>http://search.socialentrepreneurapi.org/entrepreneurs.json?q=water?li...

Peter Deitz

unread,
Nov 20, 2009, 4:48:44 PM11/20/09
to social-ac...@googlegroups.com
Hi Sam,

If it's any help, you can have a look at the code base. Of course, this
would assume you speak Ruby.

https://code.launchpad.net/socialactions

All the best,
Peter

Jason Mott

unread,
Nov 23, 2009, 1:40:05 PM11/23/09
to social-ac...@googlegroups.com
Searching by category is coming soon (tomorrow morning). Searching by
location is something that may take a little longer. We have enough
information for most entries to at least geocode by city, but I still
have to add the geocoding library. I'll get back to you tomorrow on when
I think that'll be complete.

In terms of search syntax, we use sphinx 0.9.8 in "extended match" mode.
The syntax is outlined right here:

http://www.sphinxsearch.com/docs/manual-0.9.8.html#extended-syntax

For sorting, you can add an 'order' field to url's query string with any
one of the the following values:

'title' , 'description', 'subtitle', 'url', 'latitude', 'longitude',
'expires_at', 'profile_source_id',
'profile_first_name', 'profile_middle_name', 'profile_last_name',
'profile_email', 'profile_citizenship',
'profile_location', 'profile_picture', 'profile_url', 'profile_rss',
'program_name','program_url', 'program_email', 'organization_name',
'organization_url', 'organization_location','orgainization_email',
'ein', 'created_at'

Category sorting will be supported when category search goes live.
> --
>
> You received this message because you are subscribed to the Google Groups "Social Actions Developers" group.
> To post to this group, send email to social-ac...@googlegroups.com.
> To unsubscribe from this group, send email to social-actions-...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/social-actions-dev?hl=.
>
>
>

Peter Deitz

unread,
Nov 23, 2009, 2:18:57 PM11/23/09
to social-ac...@googlegroups.com
Jason,

Two questions:

1) To clarify, is it currently possible to do a query that only shows
results for a specific country, state, or city (if that information is
available)? If so, this might suffice in lieu of the geocoding library.

2) Are you waiting on me for anything regarding going live with category
search?

All the best,
Peter

Jason Mott wrote:

Jason Mott

unread,
Nov 23, 2009, 2:28:40 PM11/23/09
to social-ac...@googlegroups.com
The issue is that the data isn't normalized. We just have a "location"
field that providers fill in any way they want. So filtering by that
value will produce very mixed results and depends greatly on the
searcher knowing what values are used by the providers (although is
currently supported as outlined already: use @profile_location
"[location string]").

Geocoding will normalize the values because geocoding libraries are very
good at taking un-normalized text strings that represent locations and
coming back with latitude and longitude values (that we then store and
use for searching and sorting).

Christine Egger

unread,
Nov 25, 2009, 4:34:53 PM11/25/09
to Social Actions Developers
Hi all,

FYI we've been further "rolling up" the issues and regions in the SE
API dataset. A revised spreadsheet is available via the SE API Google
group files (spreadsheet dated 11/24/09).

http://groups.google.com/group/social-entrepreneur-api/files?hl=en
Social Entrepreneur API Categories - Issue, Region -- draft --
112409.xls

Keep questions/suggestions coming...

Happy U.S. Thanksgiving wishes, too,
Christine
Reply all
Reply to author
Forward
0 new messages