4 ms·
For example what's the difference between "filter[queries][]" and "q" arguments for http://www.thriftdb.com/documentation/rest-api/search-api http://www.thriftd
by k7d 15y ago
For example what's the difference between "filter[queries][]" and "q" arguments for http://www.thriftdb.com/documentation/rest-api/search-api http://www.thriftdb.com/documentation/rest-api/search-api? The way I understand, q does a simple keyword matching on all fields while "filter[queries][]" is more like SQL "where" query. In that case, what operators are supported?
- andres 15y agoThe `q` argument is used to perform a full-text search across all fields. One benefit to using `q` is that you can rank results based on field matches (using the `weights` argument). The `filter` arguments are used to cut the data before performing a full-text query: `filter[fields][fieldname]` can be used to filter on fieldnames: http://api.thriftdb.com/api.hnsearch.com/items/_search?filter[fields][username][]=andres http://api.thriftdb.com/api.hnsearch.com/items/_search?filte... `filter[queries][]` can be used to add arbitrary filters: http://api.thriftdb.com/api.hnsearch.com/items/_search?filter[queries][]=username:andres http://api.thriftdb.com/api.hnsearch.com/items/_search?filte... http://api.thriftdb.com/api.hnsearch.com/items/_search?filter[queries][]=create_ts:[NOW-5DAYS%20TO%20NOW] http://api.thriftdb.com/api.hnsearch.com/items/_search?filte... The syntax for filter queries is the same as solr: http://wiki.apache.org/solr/CommonQueryParameters#fq http://wiki.apache.org/solr/CommonQueryParameters#fq