Hacker News new | ask | show | jobs
by xiekomb 2170 days ago
yes this is exactly what I (most users?) would need. Search for exact phrase would be a plus also. Eg: "donald trump" instead of Donald AND trump. What kind of backend are you using, a simple database or search index like elasticsearch (which would be more appropriate for such project)?
1 comments

Hi, just finished implementing this stuff. To search a AND b use 'q=A+B'. Here are a few examples:

> curl -XGET -G 'api.datanews.io/v1/news' -d 'apiKey=API_KEY' --data-urlencode 'q="Europe throws new rule book at Google, tech giants to loosen market grip"'

> curl -XGET -G 'api.datanews.io/v1/news' -d 'apiKey=API_KEY' --data-urlencode 'q=google+facebook+amazon'

Supported operators:

+ AND, | OR, - NOT, () parentheses for grouping, "" exact match

EDIT: examples

Kudos!