[Developers] MQLRead Query to Replicate Search Service

Andi Vajda vajda at metaweb.com
Sun May 17 16:23:49 UTC 2009


  Hi James,

On Sun, 17 May 2009, James Alexander Levy wrote:

> I'd like to run several queries against the search service with a single
> HTTP request - you know, for efficiency and all that. Because there's no way
> to do this (right?) I'll have to use MQLRead for its query envelope, but I'm
> not sure how to perform a read request that exactly mimics the search
> service.
> 
> I've tried using the wildcard modifier and name=~ property, but I'm unable
> to find a way to get results in the same ranked order as they are returned
> from the search service.
> 
> Any ideas or suggestions?

I'm not sure I understand the first half of your question about avoiding 
HTTP requests and using MQLRead for its query envelope to go about avoiding 
HTTP api/service/search requests.

api/service/search and api/service/mqlread are two distinct services 
implemented separately and differently. The search services works off of a 
Lucene full text index of Freebase and is higher level than MQLRead. It can 
invoke MQLRead.

MQLRead is an interface to MQL, our query language used to query Freebase 
directly, and is not meant to be used for text search. At the moment, it 
cannot invoke the search service (but we're working on that).

Using api/service/search, you can have matches then submitted to MQLRead via 
the mql_output and mql_filter parameters to invoke MQLRead.

See the documentation at http://api.freebase.com/api/service/search?help
for more information about these parameters, in particular:
     http://api.freebase.com/api/service/search?help#queried
     http://api.freebase.com/api/service/search?help#joining

Andi..


More information about the Developers mailing list