I need combine this 2 query in one, and sort by Id,
select GEODIST(40, 50, latitude,longitude, {in=degrees, out=meters}) AS distance, id FROM offersRT WHERE distance<=1000 LIMIT 0,30;
and
select 0 as distance, id FROM offersRT WHERE MATCH('@location_path_id 39644') LIMIT 0,30;
I use Manticore 3.6.0.
I can't use OR statement like
WHERE distance<=1000 or MATCH('@location_path_id 39644')
i also try like this:
SELECT id FROM (
select 0 as distance, id FROM offersRT WHERE MATCH('@location_path_id 39644') LIMIT 0,30;
select GEODIST(40, 50, latitude,longitude, {in=degrees, out=meters}) AS distance, id FROM offersRT WHERE distance<=1000 LIMIT 0,30;
);
and not working too.
Is there any other option to do this?
Well it MATCH('@location_path_id 39644') doesnt really need to use the 'keywords' index. Its not a really a keyword match, and something that can easily be done with an attribute filter. Ie can just make
location_path_idan attribute.Manticore at least should then support OR directly in the WHERE (it just doesn't with MATCH)
But if that doesn't work, can definitely implement the 'OR' in the SELECT section
The second form should work even in Sphinx.