Changeset 4385
- Timestamp:
- 01/29/14 13:25:46 (11 years ago)
- Location:
- vlo/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/trunk
- Property svn:mergeinfo changed
/vlo/branches/vlo-2.18 (added) merged: 4282,4284,4291,4308,4311,4313,4316-4318,4384
- Property svn:mergeinfo changed
-
vlo/trunk/UPGRADE
- Property svn:mergeinfo deleted
-
vlo/trunk/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/dao/AutoCompleteDao.java
r2768 r4385 11 11 /** 12 12 * DAO that delivers suggestions for incomplete terms (autocomplete function) 13 * 13 * 14 14 * @author Thomas Eckart 15 15 * 16 16 */ 17 17 public class AutoCompleteDao extends SolrDao { 18 19 /** 20 * Returns list of suggestions for incomplete input (used for autocomplete function) 21 * @param input user input 22 * @return list of suggestions 23 */ 24 public List<String> getChoices(String input) { 25 List<String> choices = new ArrayList<String>(); 26 27 SolrQuery query = new SolrQuery(); 28 query.setQuery(input.toLowerCase()); 29 query.setQueryType("/suggest"); 30 QueryResponse response = fireQuery(query); 31 if(response.getSpellCheckResponse() != null) { 32 List<Suggestion> suggestions = response.getSpellCheckResponse().getSuggestions(); 33 if(suggestions.size() > 0) { 34 Iterator<String> iter = suggestions.get(0).getAlternatives().iterator(); 35 while(iter.hasNext()) { 36 choices.add(iter.next()); 37 } 38 } 39 } 40 41 return choices; 42 } 18 19 /** 20 * Returns list of suggestions for incomplete input (used for autocomplete 21 * function) 22 * 23 * @param input user input 24 * @return list of suggestions 25 */ 26 public List<String> getChoices(String input) { 27 List<String> choices = new ArrayList<String>(); 28 29 if (input != null) { 30 SolrQuery query = new SolrQuery(); 31 query.setQuery(input.toLowerCase()); 32 query.setQueryType("/suggest"); 33 QueryResponse response = fireQuery(query); 34 if (response.getSpellCheckResponse() != null) { 35 List<Suggestion> suggestions = response.getSpellCheckResponse().getSuggestions(); 36 if (suggestions.size() > 0) { 37 Iterator<String> iter = suggestions.get(0).getAlternatives().iterator(); 38 while (iter.hasNext()) { 39 choices.add(iter.next()); 40 } 41 } 42 } 43 } 44 45 return choices; 46 } 43 47 } -
vlo/trunk/vlo_web_app/src/main/webapp/META-INF/context.xml
r4283 r4385 22 22 --> 23 23 <Context antiJARLocking="true" path="/vlo"> 24 < Parameter name="externalConfig" value="/Users/twagoo/vlo/VloConfig.xml"/>24 <!--<Parameter name="externalConfig" value="/Users/twagoo/vlo/VloConfig.xml"/>--> 25 25 <!--Parameter name="solrUrl" value="http://localhost:8084/vlo_solr/"/--> 26 26 </Context>
Note: See TracChangeset
for help on using the changeset viewer.