2

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?

Dan McGrath
  • 41,220
  • 11
  • 99
  • 130
dinobot
  • 23
  • 2
  • 3
    It says it's "Available in Python | Java | Go ". Would you consider the idea of building a module in Python/Java/Go to do the Search API calls while the rest of your application remains in PHP? With GAE you can mix modules made with different languages. – Mario Sep 24 '14 at 07:38
  • I thought about deploying a small app on a different version of the same GAE application to handle searches, but your way sounds better. You got any documentation on how to add modules with a different language to GAE? – dinobot Sep 24 '14 at 17:20
  • You don't need a different version. The documentation that Julldar provides is OK. You just create a module as you did with your application, with its language and YAML file (or XML for Java), and you use its specific URLs to communicate with it. – Mario Sep 25 '14 at 07:48

4 Answers4

1

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.

Patrice
  • 4,641
  • 9
  • 33
  • 43
1

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

ehfeng
  • 3,807
  • 4
  • 33
  • 42
1

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

Tom
  • 1,563
  • 12
  • 12
0

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.

Bot Cyborg
  • 63
  • 4