SharePoint KQL syntax for YesNo field - sharepoint

What's the correct syntax for querying a SharePoint YesNo (boolean) field using SharePoint Keyword Query Language (KQL)?
I can't find any examples in KQL documentation and don't have a quick way of testing this either.
IsRetained:Yes
IsRetained:'Yes'
IsRetained:True
IsRetained:true
IsRetained:1

Based on my test, you can use the following keywords to search:
IsRetained:True
IsRetained:true
IsRetained:1
IsRetained:True
IsRetained:true
IsRetained:1
If searching using "IsRetained:Yes" or "IsRetained:'Yes'"

Related

Returning accented as well as normal result set via azure search filters

Does anyone know how to ensure we can return normal result as well as accented result set via the azure search filter. For e.g the below filter query in Azure search returns a name called unicorn when i check for record with name unicorn.
var result= searchServiceClient.Documents.SearchAsync<myDto>("*",new SearchParameters
{
SearchFields = new List<string> {"Name"},
Filter = "Name eq 'unicorn'"
});
This is all good but what i want is i want to write a filter such that it returns record named unicorn as well as record named únicorn (please note the first accented character) provided that both record exist.
This can be achieved when searching for such name via the search query using language or Standard ASCII folding search analyzer as mentioned in this link. What i am struggling to find out is how can we implement the same with azure filters?
Please let me know if anyone has got any solutions around this.
Filters are applied on the non-analyzed representation of the data, so I don’t think there’s any way to do any type of linguistic analysis on filters. One way to work around this is to manually create a field which only do lowercasing + asciifloding (no tokenization) and then search lucene queries that look like this:
"normal search query terms" AND customFilterColumn:"filtérValuèWithÄccents"
Basically the document would both need to match the search terms in any field AND also match the filter term in the “customFilterColumn”. This may not be sufficient for your needs, but at least you understand the art of the possible.
Using filters it won't work unless you specify in advance all the possibilities:
for example:
$filter=name eq 'unicorn' or name eq 'únicorn'
You'd better work with a different analyzer that will change accents to it's root form. As another possibility, you can try fuzzy search:
search=unicorn~&highlight=Name

Azure Search Autocomplete API not working for Fuzzy search

I have configured azure autocomplete API with all parameters. It gives results for normal keywords but when I tried with misspell keyword then it doesn't provide me expected results. Also, I have added UseFuzzyMatching=true while configuration.
eg. machine -> gives the expected results. If we try with magine then it provides 0 results from autocomplete API.
Please let me know if I'm missing any configurations to make Fuzzy workable.
I have data in my index that contains product description and comment fields 'Boormachine' or 'machine', also it provide me result in search API for this.
I have configured suggester while creation of index with the following source fields:
Comment, CommentSmall, Description,
ItemBrandDescription, Itemcode,
ItemGroupDescription,ItemSupplierCode,
SupplierCode
We have configured autocomplete API with this:
as I need to find for keyword suggestions not in group and brand name so excluded these two fields from search fields in configuration.
We can see fuzzy related configuration in autocomplete with UseFuzzyMatching flag. Please let me know if I am missing some configuration to work fuzzy in azure search autocomplete API.
For References click this Link
The behavior Azure Search is providing is correct.
Magine is a different term than machine, and probably it does not exist in your index, this is why you're getting 0 results. To enable Fuzzy Search you actually need to append the ~ symbol to the term, so your search will look like:
"search=magine~"
https://learn.microsoft.com/en-us/azure/search/query-lucene-syntax#bkmk_fuzzy

Microsoft Cognitive Academic Knowledge API - validity of EXPR parameters

When trying to query for a specific DOI attribute using the following URL:
https://api.labs.cognitive.microsoft.com/academic/v1.0/evaluate?model=latest&count=10&offset=0&attributes=Id,Ti&expr=And(Composite(DOI='doi:10.1594/PANGAEA.667386'),Y=[2000,2009])&subscription-key=SUBSCRIPTION_KEY_HERE
I get the following error:
{"Error":{"Code":"Bad Argument","Message":"Invalid query expression\r\nParameter name: expression"}}
However when accessing using a different attribute, e.g. journal ID as below:
https://api.labs.cognitive.microsoft.com/academic/v1.0/evaluate?expr=And(Composite(J.JId=114840262),Y=[2013,2015])&model=latest&count=10&offset=0&attributes=Id,Ti,J.JN,J.JId,Y&subscription-key=SUBSCRIPTION_KEY_HERE
It works fine! Why does the behaviour of the API only work with some attributes? What am I doing wrong?
Relevant documentation I've read:
https://learn.microsoft.com/en-us/azure/cognitive-services/academic-knowledge/evaluatemethod
https://learn.microsoft.com/en-us/azure/cognitive-services/academic-knowledge/queryexpressionsyntax
Not all entity attributes can be queried for/matched against; some can only be requested as part of the result when querying against other entity attribute fields.
You can reference the Paper Entity documentation to see what query operations are available for different attributes. For example citation count (CC) does not support any matching operations, hence the "none" in the "Operations" column, however journal name (J.JN) supports the equality operator.
Unfortunately, DOI is part of the "Extended" attributes, none of which support matching operations.

Azure Search not finding words containing search query

I have an index with nutritional information. A search for burger does not match hamburger or burgers.
What is the most appropriate & efficient way to be able to search for these with Azure Search? I can use wildcards to match burgers (i.e. burger*) but Azure Search does not support wildcards at the start of the query, so I can't figure out how to match hamburger.
You can achieve this by using Lucene query syntax (see link below) in azure search.
Construct your query by using querytype full (which enables Lucene query syntax) with your term as a search. As an example, to find all matches containing the word burger, construct your query like this (try it in the azure search, search explorer query window:
queryType=full&search=/.*burger.*/
Microsoft docs for Lucene query syntax

Azure search- using lucene and filters

I want to perform an Azure search on a location index (comprising of 100K records of countryCode and location information)
The need is to
a) limit the search to specified country codes
b) be able to handle fuzzy search
I am able to achieve filtered search in simple query syntax using odata syntax on
$filter=(countrycode eq 'IN' or countrycode eq 'AT' or countrycode eq 'AU')
https://learn.microsoft.com/en-us/rest/api/searchservice/odata-expression-syntax-for-azure-search
I am able to achieve fuzzy search using Lucene search by
queryType=full&search=euroe~1
as per this syntax
queryType=full&search=sydne~1&$filter=CountryCode eq 'AT' or CountryCode eq 'AU' &searchMode=All
Is there a way to use a contains instead of multiple eq. The syntax seems to be limited
There is no syntax for set containment in Azure Search. If this feature is important to you, please add an item to User Voice to help the Azure Search team prioritize.
Late answer, but what about search.in?
Your request could be:
queryType=full&search=sydne~1&$filter=search.in(CountryCode, 'AT, AU')&searchMode=All
You can find more info on OData expression syntax for Azure Search

Resources