Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
Azure Cognitive Search : Sort result by particular result String

Is there a way in azure search, to bring data orderby value to top and remaining below. Bringing the hotel's in user's location country to top and then other results

For example: See the sample data below

HotelName City Country RoomType rating
XYZ City1 India abc 4
UVW City2 Australia def 5
KWHK City3 India 6
KHUK City4 China 2

I want to get all the data, but country India should be at top result and remaining should be below. (which includes pagination).

I am doing lucene query POST search for same , and below is my query json body for same .

Query: { search: *, queryType: 'full', count: true, skip: 0, top: 10, scoringStatistics: 'global', searchMode: 'any', }

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

I believe if you include the country in your search should work, for example:

search=term OR (term and Country eq 'India')

a Similar question was answered by a MSFT product manager with more information:

https://stackoverflow.com/a/44766731/1384539

about 4 years ago · Juan Pablo Isaza Denunciar

0

You should consider using the geo.distance function in Search, basically when querying, you need to pass the current user's location as a edm.GeographyPoint in the Function, then when ordering the results, you can order them by closest to fartest location from the user. Documentation on this, there you will also see some examples https://docs.microsoft.com/en-us/azure/search/search-query-odata-geo-spatial-functions

POST /indexes/hotels/docs/search?api-version=2020-06-30
    {  
      "search": "*",  
      "orderby": "geo.distance(Location, geography'POINT(-122.12315 47.88121)')"
    }
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda