test for keywords db performance

This commit is contained in:
2017-01-07 09:10:42 +01:00
parent c283568757
commit 4f77515bbd
20 changed files with 1211 additions and 63 deletions

View File

@@ -18,6 +18,7 @@ import org.lucares.recommind.logs.Plotter;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -62,7 +63,7 @@ public class PdbController implements HardcodedValues, CollectionUtils {
@RequestMapping(path = "/autocomplete", //
method = RequestMethod.GET, //
consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, //
consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, // APPLICATION_FORM_URLENCODED_VALUE
produces = MediaType.APPLICATION_JSON_UTF8_VALUE //
)
@ResponseBody
@@ -94,11 +95,30 @@ public class PdbController implements HardcodedValues, CollectionUtils {
produces = MediaType.APPLICATION_JSON_UTF8_VALUE //
)
@ResponseBody
List<String> fields() {
List<String> fields(@RequestParam(name = "query") final String query) {
try {
final List<String> fields = db.getDb().getFields(query);
final List<String> fields = db.getDb().getFields();
return fields;
} catch (final Exception e) {
e.printStackTrace();
throw new InternalServerError(e);
}
}
@RequestMapping(path = "/fields/{fieldName}/values", //
method = RequestMethod.GET, //
consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, //
produces = MediaType.APPLICATION_JSON_UTF8_VALUE //
)
@ResponseBody
List<String> fields(@PathVariable(name = "fieldName") final String fieldName,
@RequestParam(name = "query") final String query) {
try {
final List<String> fields = db.getDb().getFieldsValues(query, fieldName);
return fields;