mirror of
https://github.com/sismics/docs.git
synced 2024-12-22 11:23:48 +01:00
Support Japanese language
This commit is contained in:
parent
7bb1f48464
commit
5507d4ca57
@ -48,5 +48,5 @@ public class Constants {
|
||||
/**
|
||||
* Supported document languages.
|
||||
*/
|
||||
public static final List<String> SUPPORTED_LANGUAGES = Lists.newArrayList("eng", "fra");
|
||||
public static final List<String> SUPPORTED_LANGUAGES = Lists.newArrayList("eng", "fra", "jpn");
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
package com.sismics.docs.core.dao.lucene;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.lucene.document.Field;
|
||||
import org.apache.lucene.document.StringField;
|
||||
@ -100,7 +102,7 @@ public class LuceneDao {
|
||||
* @return List of file IDs
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<String> search(String userId, String searchQuery, int limit) throws Exception {
|
||||
public Set<String> search(String userId, String searchQuery, int limit) throws Exception {
|
||||
// Escape query and add quotes so QueryParser generate a PhraseQuery
|
||||
searchQuery = "\"" + QueryParserUtil.escape(searchQuery) + "\"";
|
||||
|
||||
@ -125,7 +127,7 @@ public class LuceneDao {
|
||||
ScoreDoc[] docs = topDocs.scoreDocs;
|
||||
|
||||
// Extract file IDs
|
||||
List<String> fileIdList = new ArrayList<String>();
|
||||
Set<String> fileIdList = new HashSet<String>();
|
||||
for (int i = 0; i < docs.length; i++) {
|
||||
String id = searcher.doc(docs[i].doc).get("id");
|
||||
fileIdList.add(id);
|
||||
|
BIN
docs-web/src/main/webapp/img/flag/jpn.png
Normal file
BIN
docs-web/src/main/webapp/img/flag/jpn.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 420 B |
@ -26,6 +26,7 @@
|
||||
<select id="inputLanguage" ng-model="document.language">
|
||||
<option value="fra">French</option>
|
||||
<option value="eng">English</option>
|
||||
<option value="jpn">Japanese</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user