Accessing Google App Engine's Search API from

2019-07-20 02:24发布

Is there anyway to do this? I've looked in the google-api-php-client library but it's not there yet. Is there any other way or am I out of luck?

4条回答
手持菜刀,她持情操
2楼-- · 2019-07-20 02:57

I have a similar scenario as you. This might not be the best solution, but I've solved it as follows: I've created a Python module using Google Endpoints API to expose a set of methods capable of sending and receiving JSON formatted data via HTTP GET or POST. These methods allow me create Documents and Indexes or do queries. My PHP client, simply calls these urls and passes appropriate data. So effectively I have a wrapper around the search API and the python stuff is hidden inside.

查看更多
一夜七次
3楼-- · 2019-07-20 03:01

You CAN now access the Search API natively from PHP.

The library is in alpha but should make its way to release fairly soon.

It uses the Google Protocol Buffers so it's the same level of abstraction as the Python/Java/Go SDKs

https://github.com/tomwalder/php-appengine-search

Feedback appreciated!

I ran into this problem previously, so wrote a sample PHP+Python module pair to allow access to search via URL fetch to a Python module.

https://github.com/tomwalder/phpne14-text-search

查看更多
Lonely孤独者°
4楼-- · 2019-07-20 03:08

The search API is only enabled for Python Java and Go, as Mario pointed out.

I would look into the modules documentation and try to separate your logic. Your search API can be the only module that isn't in PHP. There is no other solution for your problem unfortunately.

查看更多
姐就是有狂的资本
5楼-- · 2019-07-20 03:12

The team promised that a REST API would be made available at Google I/O 2011. I haven't been able to find any follow ups since.

https://www.youtube.com/watch?v=7B7FyU9wW8Y#t=2088

查看更多
登录 后发表回答