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?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- java.lang.NullPointerException at java.io.PrintWri
- Can php detect if javascript is on or not?
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.
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-searchThe 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.
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