Reputation: 6371
I'm new to sphinx, and I've encountered a few problems:
$1 After setting max_matches = 200
in class searchd in csft.conf, I called
org.sphx.api.test.main(new String[]{"-h", "127.0.0.1","-i", "magnet","-p", "9312", "-l", "100", "keyword"});
in a java main method. The error returned is
Error: searchd error: per-query max_matches=1000 out of bounds (per-server max_matches=200)
As you can see, I've added the param: -l = 100
, what else should I set to prevent this error in Java?
$2 I want to use sortMode = SphinxClient.SPH_SORT_TIME_SEGMENTS
to have the search result ordering by time desc. My attribute is written like this in csft.conf:
sql_attr_timestamp=UNIX_TIMESTAMP(upload_time
) as dt
Could anyone tell me how can I set the attribute in Java code? I've tried to set the sortClause
String in java, but it always said that Attribute XXX has not been found.
$3 I want to know whether SphinxClient
in Java is thread safe, becaust I don't like to create a SphinxClient instance every time a person do a query.
Thanks in advance!
Upvotes: 0
Views: 504
Reputation: 21091
sql_attr_timestamp
simply accepts a column name, no functions or anything. The function call HAS to be in the main sql_query
Upvotes: 1