[Developers] mql_filter parameter to search API

Andi Vajda vajda at metaweb.com
Fri Mar 13 19:58:56 UTC 2009


On Fri, 13 Mar 2009, Scott Meyer wrote:

> Andi Vajda wrote:
>> On Fri, 13 Mar 2009, Philip Kendall wrote:
>>
>>> What I'm trying to do is to get a list of all properties within Commons
>>> that "match" a string in some way or another.
>>>
>>> I'm currently doing this via the search API[1] and then post-filtering
>>> the results to remove any which have ids starting with /user/, /base/ or
>>> /guid/. This obviously isn't ideal as it means I throw away a large
>>> number of results, and may not find the results I'm looking for if
>>> they're further down the list, but just hidden by lots of user-created
>>> properties.
>>>
>>> There's an "mql_filter" parameter documented from the search API, but I
>>> can't get it to do anything useful (other than blow up, which I've filed
>>> a bug for[2]).
>>
>> You've hit a limitation on mql_filter, here.
>> I should fix this 500 by changing it into a 400 whereby the filter is
>> returned as invalid.
>>
>> Basically, the way mql_filter works is that the guids of search matches are
>> passed to it via a guid|= clause. That clashes with your id clause, MQL
>> doesn't allow matching on both.
>
> I believe the mql_filter you're looking for looks something like this:
>
> [{
>  "type": "/type/property",
>  "schema": {
>    "domain": {
>      "key": {
>        "namespace": "/"
>      }
>    }
>  }
> }]

The mql_filter query is centered around the guids returned by relevance. 
Unless that relevance query returns guids of properties, this filter is not 
going to return much.

Andi..

>
> This asks for properties of types in top-level domains (ie. /government).
>
> -Scott
>


More information about the Developers mailing list