diff --git a/conf/sphinx.conf.in b/conf/sphinx.conf.in
index 6d6a7471..3cf559d1 100755
--- a/conf/sphinx.conf.in
+++ b/conf/sphinx.conf.in
@@ -13,6 +13,7 @@ source src_swisssearch : def_pqsql
sql_db = search
sql_attr_uint = num
sql_attr_bigint = id
+ sql_attr_bigint = len
sql_attr_uint = rank
sql_attr_string = label
sql_attr_string = origin
@@ -27,9 +28,10 @@ source src_address : src_swisssearch
gid as id \
, search_name as detail \
, coalesce(strname1,'')||' '||coalesce(deinr,'')||' '||coalesce(plz,'')||' '||coalesce(ort_27,'')||'' as label \
+ , textlen(search_name) as len \
, origin as origin \
, st_box2d(the_geom) as geom_st_box2d \
- , 6 as rank \
+ , rank as rank \
, gid as id \
, NULLIF(regexp_replace(deinr::text, '[^0-9]'::text, ''::text, 'g'::text), ''::text)::integer as num \
from swiss_search \
@@ -43,9 +45,10 @@ source src_parcel : src_swisssearch
gid as id \
, search_name as detail \
, coalesce(gemname,'')||' '||coalesce(name,'') as label \
+ , textlen(search_name) as len \
, origin as origin \
, st_box2d(the_geom) as geom_st_box2d \
- , 7 as rank \
+ , rank as rank \
, gid as id \
, SUBSTRING(name FROM '([0-9]+)')::int as num \
from swiss_search \
@@ -59,6 +62,7 @@ source src_sn25 : src_swisssearch
gid as id \
, search_name as detail \
, ''||coalesce(name,'')||' ('||coalesce(kanton,'')||') - '||coalesce(gemname,'') as label \
+ , textlen(search_name) as len \
, origin as origin \
, st_box2d(the_geom) as geom_st_box2d \
, rank as rank \
@@ -75,6 +79,7 @@ source src_gg25 : src_swisssearch
gid as id \
, search_name as detail \
, ''||coalesce(gemname,'')||' ('||coalesce(kanton,'')||')' as label \
+ , textlen(search_name) as len \
, origin as origin \
, st_box2d(the_geom) as geom_st_box2d \
, rank as rank \
@@ -90,6 +95,7 @@ source src_kantone : src_swisssearch
SELECT \
gid as id \
, remove_accents(search_name) as detail \
+ , textlen(search_name) as len \
, ''||name||'' as label \
, origin as origin \
, st_box2d(the_geom) as geom_st_box2d \
@@ -106,6 +112,7 @@ source src_district : src_swisssearch
SELECT \
gid as id \
, search_name as detail \
+ , textlen(search_name) as len \
, ''||name||'' as label \
, origin as origin \
, st_box2d(the_geom) as geom_st_box2d \
@@ -123,6 +130,7 @@ source src_zipcode : src_swisssearch
gid as id \
, search_name as detail \
, ''||coalesce(plz,'')||' - '||coalesce(ort_27,'')||' ('||coalesce(kanton,'')||')' as label \
+ , textlen(search_name) as len \
, origin as origin \
, st_box2d(the_geom) as geom_st_box2d \
, rank as rank \