aboutsummaryrefslogtreecommitdiff
path: root/juick-server-jdbc/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server-jdbc/src/main/java/com')
-rw-r--r--juick-server-jdbc/src/main/java/com/juick/service/SphinxSearchService.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/SphinxSearchService.java b/juick-server-jdbc/src/main/java/com/juick/service/SphinxSearchService.java
index d8330908..7de0680e 100644
--- a/juick-server-jdbc/src/main/java/com/juick/service/SphinxSearchService.java
+++ b/juick-server-jdbc/src/main/java/com/juick/service/SphinxSearchService.java
@@ -52,8 +52,9 @@ public class SphinxSearchService extends BaseJdbcService implements SearchServic
}
return getJdbcTemplate().queryForList(
- "SELECT id FROM search WHERE query = '?;?'", Integer.class, searchString,
- sphinxQuery.keySet().stream().map(Object::toString).collect(Collectors.joining(";")));
+ String.format("SELECT id FROM search WHERE query = '%s;%s'", searchString,
+ sphinxQuery.keySet().stream().map(Object::toString)
+ .collect(Collectors.joining(";"))), Integer.class);
}
@Override
@@ -69,9 +70,9 @@ public class SphinxSearchService extends BaseJdbcService implements SearchServic
sphinxQuery.put("maxid", String.valueOf(messageIdBefore - 1));
}
return getJdbcTemplate().queryForList(
- "SELECT id FROM search WHERE query = '?;filter=user_id,?;?'",
- Integer.class, searchString, userId,
- sphinxQuery.keySet().stream().map(Object::toString).collect(Collectors.joining(";")));
+ String.format("SELECT id FROM search WHERE query = '%s;%s;filter=user_id,%d'", searchString,
+ sphinxQuery.keySet().stream().map(Object::toString)
+ .collect(Collectors.joining(";")), userId), Integer.class);
}
@Override