MS Graph API "AND" criteria in $search - rest

I am using the Microsoft Graph API and not getting expected results when using the AND criteria.
If i was to query:
https://graph.microsoft.com/beta/users/{UserGUID}/messages?$search="to:customeraddress.com"
I would get a result containing all emails from that customer.
However if i change the search criteria to
$search="to:customeraddress.ac.uk AND sender:myDomain.com"
or
$search="to:customeraddress.ac.uk AND from:myDomain.com"
some of the emails that were originally returned are now missing even though they are from the mydomain address.
Have i got something wrong?
I have followed information from the following locations:
https://developer.microsoft.com/en-us/graph/docs/concepts/query_parameters#search-parameter
https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference
https://technet.microsoft.com/en-us/library/dn774955(v=exchg.160).aspx

Related

Microsoft Graph REST API: Filter signIns by Country

I am trying to query the Microsoft GRAPH REST API as follows:
https://graph.microsoft.com/beta/auditLogs/signIns$filter=location/any(c:c/countryOrRegion eq 'CA')
However I am receiving a 400: Invalid filter clause error.
If I do a simple query such as $filter=userDisplayName eq 'Bob Smith' my query works fine.
What is the correct way to filter signIns by Country in Graph?
Syntax for filter sub-property -
$filter=property/subProperty eq 'value-to-match'
You can try using below query
https://graph.microsoft.com/beta/auditLogs/signins?$filter=location/countryOrRegion eq 'IN'
For more info you can check the docs for filter query parameters - https://learn.microsoft.com/en-us/graph/filter-query-parameter

Searching in FQL query returns only few results instead of 400~

I did this query: SELECT id, username, name, pic_square FROM profile WHERE contains('Restaurants in Vilnius, Lithuania'), as a result I got only 23 results. Hovewer if I search for Restaurants in Vilnius, Lithuania search box, in facebook, I get around 200-400 results. Why is that so ?
Facebook limits the API result to 25 items max and you need to use paging to get the next batch: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging
You really shouldn´t use FQL anymore, it will be gone for good after August 2016. Always use the Graph API: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#search

How to send HTTP request to sails.js + MongoDB with createdAt parameter?

I am trying to post a query to Sails.js via HTTP POST in order to find records created after a certain point in time.
Using the following syntax works perfectly and gives me back one record with the correct time:
localhost:1337/object?where={"createdAt":"2014-08-19T14:36:16.047Z"}
When trying to add an operator the query does not work any longer giving me no records in the object collection :
localhost:1337/object?where={"createdAt":{">":"2014-08-19T14:36:16.047Z"}}
Due to the fact that the date conversion from ISODate to dateTime works for the exact query I suppose it should also work for the ">" query.
Highly appreciate some help on this one.

Github API field descriptions

I'm toying with the Github search API (v3) and can't seem to find a description of the fields that are returned. Most of them are obvious, but there are a few like score that aren't. Does anyone know what score means, and does a field reference exist?
The score attribute is the search score of that document for a particular query, and is used for Best Match sorting. In other words, it's used for ranking search results, but it isn't shown in search results on github.com.

Search Facebook Graph API for long posts?

Is it possible to search the Graph API for posts a Facebook member has written where post.length > n ?
Or would I have to pull posts and parse/filter them in my code?
You can use FQL to make filtered Graph API calls.
This query will get you posts with a message containing the word "this" which are more than 50 characters long.
SELECT message, post_id FROM stream WHERE CONTAINS("this") and strlen(message) > 50 LIMIT 100
The CONTAINS() function is not documented. From my experimentation with it, it searches multiple fields and is optimized to return matches that are based on full names.