Azure search sorting like localeCompare javascript functionality - azure-cognitive-search

I am getting a record from azure search in ascending order 1.0,10.1,2, 2.1,3.1.1 But my business requirement is they want sorting like that 1.0,2,2.1,3.1.1,10.1
for more details please find attachments.
azure search

You could use $orderby=[string] asc to get record in ascending order.
Also, you could use $filter to add condition. Such as below:
&search=*&$count=true&$orderby=versionLower desc&$filter=top eq 100 and skip eq 0
For more details, you could refer to this article.

Related

How to filter by Edm.DateTimeOffset in Azure Search?

When testing the following three filter query strings in the Azure Search index search explorer, they all return the same count. It looks like it is not filtering the dates at all.
What is the correct way to filter fields that are the Edm.DateTimeOffset type?
Three query strings tested
date_time_field eq 2010-01-01T00:00:00Z&$count=true
date_time_field lt 2010-01-01T00:00:00Z&$count=true
date_time_field ge 2010-01-01T00:00:00Z&$count=true
Sample 'date_time_field' dates in the search index
2019-12-30T00:00:00Z
2020-01-08T11:01:13Z
2020-01-09T00:00:00Z
2019-12-30T00:00:00Z
2019-12-17T13:39:02Z
The query string was missing $filter=.
Full and working query
$filter=date_time_field eq 2010-01-01T00:00:00Z&$count=true

Google Data store UI can't use descending index

I have an app that uses google's datastore.
I have set up an index that uses two properties of some entity, the first one is ascending and the second one is descending.
When I try to filter by the first property (equals some value) and sort descending by the second I get an error saying that I don't have an appropriate index.
But it seems to me that its because when I click the second column it tries to sort ascending as a default and this is what failes.
Is there a way to ask the UI to filter descending (without going through ascending first) ?
You can use "Query by GQL tab" to test if its UI only problem
By default datastore creates 2 single property indexes (asc, desc) for each column, so try to apply required order first and then apply filter.

How do you include Azure Search's #search.score as part of your custom $orderby clause

According to this page, the default sort of Azure Search results is by Azure's own score (descending). However, you can supply an $orderby clause, which is defined as:
A list of comma-separated expressions to sort the results by. Each
expression can be either a field name or a call to the geo.distance()
function.
I want to sort by Azure's #search.score desc, MyFieldOne, MyFieldTwo. But, I cannot figure out how to reference the #search.score "field."
I've tried the following:
$orderby=search.score+desc,MyFieldOne,MyFieldTwo
$orderby=#search.score+desc,MyFieldOne,MyFieldTwo
$orderby=%40search.score+desc,MyFieldOne,MyFieldTwo
These all result in http 502 or 400s.
How do I reference the #search.score value in my request?
Edited
Azure Search now supports sorting by score using the new search.score() OData function. For example, to sort by score then by name, do this:
$orderby=search.score() desc, name asc
The API reference has been updated to include the new search.score() function.
Original answer:
Azure Search currently doesn't let you refer to the score in an orderby clause. Please vote for this UserVoice suggestion to help us prioritize this work.
Note, however, that score will rarely be the same for two documents, so using tie-breakers after the $oderby=#search.score will rarely come into play, and in most cases the sort order will be equivalent to sorting by rank, which is what happens by default.

How to get users from specific groups using wildcards with filters in AD?

I'm trying to do a query as follow, using All Users Filter:
(&(objectCategory=person)(objectClass=user)(memberof=CN=GROUP_*,OU=Common Groups,OU=MYCOMPA,DC=mycompa,DC=com))
I know this cant be done, but I haven't found a way to do something similar. I have 3 groups, GROUP_A, GROUP_B and GROUP_C. I want to get the users from any of these 3 groups, so something with GROUP_* should do the filter.
I tried with:
(&(objectCategory=person)(objectClass=user)(cn=GROUP_*))
But it returns nothing, since it has the DC defined. Any clue about this?. I'm not programming, just need the query.
There does not exist a single search filter to do this.
The proper way is to search for all groups you want. And then do a search for each of the groups. But this is programming. :)

solr search within subset defined by list of keys

Is it possible to perform a search with solr within a subset of data? I am using solr combined with tokyo tyrant in python
I read Searching within a subset of data - Solr but I guess it does not really fit my problem because I am not using solr.NET
What I want is to:
find the elements of the data set with code = 'xxxx' and
I want to perform the search within the a subset of data : data whose id are in a given list / or with id startswith 'yy'
So 1 is not a problem but I do not know how to do 2
thanks for your help
Does query like this work for you q=id:(id1 OR id2 OR id3) OR id:yy*
You can use id:(id1 OR id2 OR id3) to search for ids in the id field and id:yy* for the prefix query to check for ids starting with yy
if you have a server their's an administration panel where you can do some request.
but all you have to do to make request is to send an http request with good parameters, basis are explained here.
http://wiki.apache.org/solr/SolrQuerySyntax
http://wiki.apache.org/solr/CommonQueryParameters

Resources