How to use ."in" filter in Supabase URL - supabase

I am trying to use ".in" filter of Supabase using its URL. However I can't query for more than 1 filter.
Working url
https://DATABASE_URL/rest/v1/patients?payer=in.(TERM1)
Here I get all the rows where payer is TERM1. However, when I try the following
https://DATABASE_URL/rest/v1/patients?payer=in.(TERM1, TERM2)
I only get all the rows where payer is TERM1.
Expected output would be to get all the rows where payer is either TERM1 or TERM2
Payer column is of type text.
Any help would be appreciated!
Thanks.

Can you try to remove the space between TERM1 and TERM2 and try it again? Like this:
https://DATABASE_URL/rest/v1/patients?payer=in.(TERM1,TERM2)

Related

Use of array in like query with multiple append search filter

When I select more than 1 Root Scheme then it show only one result but I want to get 2 or more results in Query Append
if($rootschemeid != ""){
$query->where('rootschemes.rootschemeid','like','%'.$rootschemeid.'%');
}
Actually, I use Query Append in Search Functionality in laravel using Ajax Request but I can't get Proper result. I have more then 1 root schemes. If I select 1 by 1 then it gives me proper result but if select both at a time then it shows only first one. I also tried using impload, wherein,orwhere,subquery,like operators but did not get proper result.
I found Answer Of My Query That I use Query like This,
$query->whereIn('rootschemes.rootschemeid',$rootschemeid);
And If Any query Append After Query I Should use orWhere with subquery of laravel ,
suppose After Rootscheme Query we need to Append any other query like scheme query then I would write a query like ...
$query->orwhere(function($q) use ($schemeid){
$q->whereIn('schemes.schemeid',$schemeid);
});

Get distinct values from a field in ElasticSearch via a REST API URI

I have the following URI which should retrieve all values from the Gender field.
http://localhost:9200/persons/_search?_source=Gender
However, it does not return me all the data in the index of the Gender field. I want to get the data distinct also.
I am consuming this REST API in AngularJS. Can someone help me to achieve this type of URI query ?
Thank you.
Elasticsearch returns 10 hits by default, unless otherwise specified by size.
To get distinct values of a field use terms aggregation.
Refer: ES-return-unique-values

Possible to use GroupBy in ElasticSearch querystring?

I have a few records in my elasticsearch collection and i want to use a GroupBy aggregation in elasticsearch querystring.
I want to know if it is possible, because i tried to google it always give result about this
i want to use this something like this in the query string , which can
give me records in the group.
For i.e.
http://localhost:9200/_all/tweets/_count?q=user:Pu*+user:Kim*
This will give me count of all the records which has name starts from Pu and Kim,
But i want to know that how many records are there has name starting with Pu
and Kim,
aggregations need to be specified in addition in the search request, you cannot specify them as part of a query string query.
You could also just execute two queries to find out this particular requirement...

How can i do a multiple search query within a single URI in ElasticSearch?

I'm trying to get results of an index, by sending an GET http call from Postman for both date range and for a field ("log_type") which I added manually,
So for now I'm able to get the results, when i query it individually such as:
Date Range: http://localhost:9200/dialog_test/_search?q=timestamp:[2016-08-05+TO+2016-08-06]
log_type: http://localhost:9200/dialog_test/_search?q=log_type:GetProvisioning%20SUCCESS
In the url above (log_type), GetProvisioning Success is a log_type.
So what I wanted to know is, how can I combine both of them into a single query in order to identify, what're the results between a certain date range and with a specific log_type?
Any help could be appreciated
You can use AND and OR boolean conjunctions per query strings. In your case, you can do something like:
curl http://localhost:9200/dialog_test/_search?q=timestamp:[2016-08-05+TO+2016-08-06]+AND+log_type:GetProvisioning+SUCCESS
Also, you could use the source query string parameter in order to pass the body directly in the URL. For example:
http://localhost:9200/my_index/_search?source={"query": {"match_all": {}},"size": "1","sort": [{"#timestamp": {"order": "desc"}}]}

How to add a numeric filter on kibana dashboard?

I have a field that contains numbers. I want a filter that shows all logs that are less than a constant value.
When I try to add a new query filter, all I can see is a query string option.
If you are talking about the query field a syntax like this works:
field:<10
Will find just records with a field value less than 10. Found this by experimentation one day -- don't know if it's documented anywhere.

Resources