Revize 7be18951
Přidáno uživatelem Jitka Poubová před více než 4 roky(ů)
be/fulltextsearch/src/main/java/cz/zcu/kiv/aswi/fulltextsearch/IndexController.java | ||
---|---|---|
26 | 26 |
String response; |
27 | 27 |
|
28 | 28 |
try { |
29 |
response = "Found: " + solrService.query(query.getQuery());
|
|
29 |
response = solrService.query(query.getQuery()); |
|
30 | 30 |
} catch (IOException e) { |
31 | 31 |
response = "IOException"; |
32 | 32 |
} catch (SolrServerException e) { |
... | ... | |
55 | 55 |
|
56 | 56 |
@GetMapping("/documents") |
57 | 57 |
public List<DocumentResponse> uploadFile() { |
58 |
List<DocumentResponse> response = new ArrayList<>(); |
|
58 | 59 |
|
59 |
// TODO : získat všechny uložené dokumenty v systému |
|
60 |
|
|
61 |
return new ArrayList<>() { |
|
62 |
{ |
|
63 |
add(new DocumentResponse("soap-ch_knihovna_ascher-zeitung-1866-06-16-n24_0855", 1)); |
|
64 |
add(new DocumentResponse("soap-ch_knihovna_ascher-zeitung-1866-09-15-n37_1365", 2)); |
|
65 |
add(new DocumentResponse("soap-ch_knihovna_ascher-zeitung-1866-08-25-n34_1255", 3)); |
|
66 |
add(new DocumentResponse("soap-ch_knihovna_ascher-zeitung-1866-07-07-n27_0980", 4)); |
|
60 |
try { |
|
61 |
List<String> filenames = solrService.listAllFiles(); |
|
62 |
int id = 0; // todo |
|
63 |
for (String filename: filenames) { |
|
64 |
response.add(new DocumentResponse(filename, id++)); |
|
67 | 65 |
} |
68 |
}; |
|
66 |
} catch (IOException e) { |
|
67 |
// todo |
|
68 |
} catch (SolrServerException e) { |
|
69 |
// todo |
|
70 |
} catch (Exception e) { |
|
71 |
// todo |
|
72 |
} |
|
69 | 73 |
|
74 |
return response; |
|
70 | 75 |
} |
71 | 76 |
|
72 | 77 |
|
Také k dispozici: Unified diff
Re #7728: Přidávání více dokumentů
- do Solru se přidává 5 dokumentů
- získání informací o všech dokumentech v Solru