2017-12-13 11 views
0

인덱싱을 수행 할 테이블이 4 개 있습니다. 내 문제는테이블에 우선 순위를 설정하는 방법은 무엇입니까?

저는 무게가 아닌 테이블 우선 순위에 의한 검색 결과를 얻고 싶습니다. I 평균 표 1의 일치 검색 결과는 처음에는 표 2와 같이 나타납니다.

현재 가장 높은 무게로 결과를 검색하고 있습니다.

쿼리

Select UUID_SHORT() AS sphinxid, info as keyword, 'column_name' as type from table 1 
UNION ALL 
Select UUID_SHORT() AS sphinxid, info as keyword, 'column_name' as type from table 2 
UNION ALL 
Select UUID_SHORT() AS sphinxid, info as keyword, 'column_name' as type from table 3 
UNION ALL 
Select UUID_SHORT() AS sphinxid, info as keyword, 'column_name' as type from table 4; 

답변

0

잘 경우 여전히 원래 SphinxAPI를 사용하여 SetIndexWeights있다. http://sphinxsearch.com/docs/current.html#api-func-setindexweights 데이터를 별도의 실제 인덱스로 분할해야합니다.

... SphinxQL과 동등한 요소가 없습니다. 쿼리를 실행할 때 AFAIK

은 아마도 단순한는 요인

sphinxQL> SELECT id,WEIGHT()*multiplier AS w FROM index WHERE MATCH(..) ORDER BY w DESC; 
을 사용할 수, 인덱스 그런

sql_query = \ 
Select ...,8 as multiplier from table1 \ 
UNION ALL \ 
Select ...,4 as multiplier from table2 \ 
UNION ALL \ 
... 

sql_attr_uint = multiplier 

에 새로운 속성을 추가 할 수