Разделен индекс на основу (полную форму) и сокращение. Поправлено Readme с учетом новых реалий.
This commit is contained in:
@@ -125,14 +125,14 @@ class SphinxSearch:
|
||||
|
||||
# формируем строки для поиска в Сфинксе
|
||||
for i in range(good_vars_word_count, max(0, good_vars_word_count - 3), -1):
|
||||
first_q = "\"{}\"/{}".format(" ".join(good_var.text for good_var in good_vars), i)
|
||||
first_q = "@fullname \"{}\"/{}".format(" ".join(good_var.text for good_var in good_vars), i)
|
||||
|
||||
if self.search_freq_words:
|
||||
for j in range(freq_vars_word_count, -1, -1):
|
||||
if j == 0:
|
||||
second_q = ""
|
||||
else:
|
||||
second_q = " \"{}\"/{}".format(" ".join(freq_var.text for freq_var in freq_vars), j)
|
||||
second_q = " @sname \"{}\"/{}".format(" ".join(freq_var.text for freq_var in freq_vars), j)
|
||||
second_q = second_q.replace("*", "")
|
||||
|
||||
print first_q + second_q
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
|
||||
WITH RECURSIVE PATH (cnt, aoid, aoguid, aolevel, fullname) AS (
|
||||
SELECT ao.id as cnt, ao.aoid, ao.aoguid, ao.aolevel,
|
||||
ao.shortname || ' ' || ao.formalname AS fullname
|
||||
ao.shortname || ' ' || ao.formalname AS fullname,
|
||||
ao.shortname || '' AS sname
|
||||
FROM "ADDROBJ" AS ao
|
||||
WHERE aolevel = 1 AND actstatus = TRUE AND livestatus = TRUE AND nextid IS NULL
|
||||
UNION
|
||||
SELECT child.id as cnt, child.aoid, child.aoguid, child.aolevel,
|
||||
PATH.fullname || ', ' || child.shortname || ' ' || child.formalname AS fullname
|
||||
PATH.fullname || ', ' || child.shortname || ' ' || child.formalname AS fullname,
|
||||
PATH.sname || ' ' || child.shortname AS sname
|
||||
FROM "ADDROBJ" AS child
|
||||
, PATH
|
||||
WHERE child.parentguid = PATH.aoguid AND actstatus = TRUE AND livestatus = TRUE AND nextid IS NULL
|
||||
)
|
||||
SELECT p.cnt, p.aoid, p.fullname, length(p.fullname)-length(replace(p.fullname, ' ', '')) as wordcount FROM PATH p WHERE p.AOLEVEL NOT IN (1, 3)
|
||||
SELECT p.cnt, p.aoid, p.fullname, p.sname, length(p.fullname)-length(replace(p.fullname, ' ', '')) as wordcount FROM PATH p WHERE p.AOLEVEL NOT IN (1, 3)
|
||||
@@ -10,9 +10,9 @@ source {{index_name}}
|
||||
sql_query = {{!sql_query}}
|
||||
|
||||
sql_field_string = fullname
|
||||
sql_field_string = sname
|
||||
sql_attr_uint = wordcount
|
||||
sql_attr_string = aoid
|
||||
sql_attr_string = aoguid
|
||||
}
|
||||
|
||||
index {{ index_name }}
|
||||
|
||||
@@ -33,11 +33,11 @@ searchd
|
||||
|
||||
# client read timeout, seconds
|
||||
# optional, default is 5
|
||||
read_timeout = 5
|
||||
read_timeout = 7
|
||||
|
||||
# maximum amount of children to fork (concurrent searches to run)
|
||||
# optional, default is 0 (unlimited)
|
||||
max_children = 30
|
||||
max_children = 4
|
||||
|
||||
# PID file, searchd process ID file name
|
||||
# mandatory
|
||||
@@ -59,5 +59,7 @@ searchd
|
||||
# whether to unlink .old index copies on succesful rotation.
|
||||
# optional, default is 1 (do unlink)
|
||||
unlink_old = 1
|
||||
|
||||
expansion_limit = 48
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user