simplonco / carto-emploi

Projet de cartographie des emplois du numérique en France
0 stars 3 forks source link

[API]Spec : Order by title ? Publication date ? #13

Closed annemarie35 closed 9 years ago

annemarie35 commented 9 years ago

Search engine for database can be modify. The sql query looks like (for geosearch) SELECT *, distance FROM (SELECT *, ( 6371 * acos( cos( radians( #{@lat} ) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(#{@lng}) ) + sin( radians(#{@lat}) ) * sin( radians( latitude ) ) ) ) AS distance FROM job_offers ) AS dt WHERE distance < #{@distance} AND to_tsvector('french', offer_description || ' ' || title) @@ plainto_tsquery('french', '#{job}') ORDER BY publication_date DESC LIMIT #{limit} OFFSET #{bg_offers} ;

I choose more recent offers but it could be, job title or anything else (in the case of offers can be seen in a more traditionnal way than the map)

annemarie35 commented 9 years ago

Publication_date !