Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
119 lines (106 sloc) 4.17 KB
source items
{
type = mysql
sql_host = localhost
sql_user = fsphinx
sql_pass = fsphinx
sql_db = fsphinx
sql_port = 3306
sql_query_pre = set character_set_results = utf8
# make sure we don't chop off fields with multiple values
sql_query_pre = set group_concat_max_len = 50000
# search in all fields including facets
sql_query = \
select \
imdb_id, \
filename, \
title, \
year, \
plot, \
also_known_as, \
imdb_id as id, \
certification, \
\
year as year_attr, \
user_rating as user_rating_attr, \
nb_votes as nb_votes_attr, \
unix_timestamp(release_date) as release_date_attr, \
runtime as runtime_attr, \
\
1 as log_score_attr, \
\
(select group_concat(distinct genre) from genres as g where g.imdb_id = t.imdb_id) as genres, \
(select group_concat(distinct director_name) from directors as d where d.imdb_id = t.imdb_id) as directors, \
(select group_concat(distinct actor_name) from casts as c where c.imdb_id = t.imdb_id) as actors, \
(select group_concat(distinct plot_keyword) from plot_keywords as p where p.imdb_id = t.imdb_id) as plot_keywords\
from titles as t
# sort by year, user_ratings * nb_votes, release_date, runtime
sql_attr_float = user_rating_attr
sql_attr_uint = nb_votes_attr
sql_attr_timestamp = release_date_attr
sql_attr_uint = runtime_attr
# for similarity search
sql_attr_float = log_score_attr
# facets are year, directors, actors, genres, keywords
sql_attr_uint = year_attr
sql_attr_multi = \
uint genre_attr from query; \
select g.imdb_id, t.id from genres as g, genre_terms as t where g.genre = t.genre
sql_attr_multi = \
uint director_attr from query; \
select imdb_id, imdb_director_id from directors
sql_attr_multi = \
uint actor_attr from query; \
select imdb_id, imdb_actor_id from casts
sql_attr_multi = \
uint plot_keyword_attr from query; \
select p.imdb_id, t.id from plot_keywords as p, plot_keyword_terms as t where p.plot_keyword = t.plot_keyword
sql_query_info = \
select \
imdb_id, \
filename, \
title, \
year, \
plot, \
also_known_as, \
imdb_id as id, \
certification, \
\
year as year_attr, \
user_rating as user_rating_attr, \
nb_votes as nb_votes_attr, \
unix_timestamp(release_date) as release_date_attr, \
runtime as runtime_attr, \
\
(select group_concat(distinct genre) from genres as g where g.imdb_id = t.imdb_id) as genres, \
(select group_concat(distinct director_name) from directors as d where d.imdb_id = t.imdb_id) as directors, \
(select group_concat(distinct actor_name) from casts as c where c.imdb_id = t.imdb_id) as actors, \
(select group_concat(distinct plot_keyword) from plot_keywords as p where p.imdb_id = t.imdb_id) as plot_keywords\
from titles as t \
where imdb_id = $id
}
index items
{
source = items
path = data/sph-index/
#morphology = stem_en
#stopwords = data/stopwords.txt
#synonyms = data/synonyms.txt
min_word_len = 1 # we have to do this to search in certification field
charset_type = utf-8
}
indexer
{
mem_limit = 300M
}
searchd
{
listen = localhost:10001
read_timeout = 5
max_children = 30
max_matches = 1000
seamless_rotate = 1
log = data/sph-logs/searchd.log
query_log = data/sph-logs/query.log
pid_file = data/sph-logs/searchd.pid
}
Something went wrong with that request. Please try again.