当前位置: 首页>>代码示例>>Java>>正文


Java SearchDTO.setAdditionalProperties方法代码示例

本文整理汇总了Java中org.sunbird.dto.SearchDTO.setAdditionalProperties方法的典型用法代码示例。如果您正苦于以下问题:Java SearchDTO.setAdditionalProperties方法的具体用法?Java SearchDTO.setAdditionalProperties怎么用?Java SearchDTO.setAdditionalProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.sunbird.dto.SearchDTO的用法示例。


在下文中一共展示了SearchDTO.setAdditionalProperties方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOrgsData

import org.sunbird.dto.SearchDTO; //导入方法依赖的package包/类
/**
 * @param actorMessage
 */
private Map<String, Object> getOrgsData(Request actorMessage) {
  Map<String, Object> requestMap = actorMessage.getRequest();
  SearchDTO dto = new SearchDTO();
  Map<String, Object> map = new HashMap<String, Object>();
  // TODO need to check with request body what data we will get
  // map.put(JsonKey.REGISTERED_ORG_ID, "some value");
  // map.put(JsonKey.ROOT_ORG_ID, "");
  Map<String, Object> additionalProperty = new HashMap<>();
  additionalProperty.put(JsonKey.FILTERS, map);
  dto.setAdditionalProperties(additionalProperty);
  Map<String, Object> responseMap = ElasticSearchUtil.complexSearch(dto,
      ProjectUtil.EsIndex.sunbird.getIndexName(), ProjectUtil.EsType.organisation.getTypeName());
  if (requestMap != null) {
    return responseMap;
  }
  return null;

}
 
开发者ID:project-sunbird,项目名称:sunbird-lms-mw,代码行数:22,代码来源:OrganisationManagementActor.java

示例2: getUserDetails

import org.sunbird.dto.SearchDTO; //导入方法依赖的package包/类
/**
 * @param actorMessage
 */
private void getUserDetails(Request actorMessage) {
  Map<String, Object> requestMap = actorMessage.getRequest();
  SearchDTO dto = new SearchDTO();
  Map<String, Object> map = new HashMap<>();
  map.put(JsonKey.REGISTERED_ORG_ID, requestMap.get(JsonKey.REGISTERED_ORG_ID));
  map.put(JsonKey.ROOT_ORG_ID, requestMap.get(JsonKey.ROOT_ORG_ID));
  Map<String, Object> additionalProperty = new HashMap<>();
  additionalProperty.put(JsonKey.FILTERS, map);
  dto.setAdditionalProperties(additionalProperty);
  Map<String, Object> responseMap = ElasticSearchUtil.complexSearch(dto,
      ProjectUtil.EsIndex.sunbird.getIndexName(), ProjectUtil.EsType.user.getTypeName());
  Response response = new Response();
  response.put(JsonKey.RESPONSE, responseMap);
  sender().tell(response, self());
}
 
开发者ID:project-sunbird,项目名称:sunbird-lms-mw,代码行数:19,代码来源:UserManagementActor.java

示例3: testComplexSearchWithRangeGreater

import org.sunbird.dto.SearchDTO; //导入方法依赖的package包/类
@Test
public void testComplexSearchWithRangeGreater(){
    SearchDTO searchDTO = new SearchDTO();
    Map<String , Object> additionalProperties = new HashMap<String , Object>();
    List<Integer> sizes = new ArrayList<Integer>();
    sizes.add(10);
    sizes.add(20);
    Map<String , Object> filterMap = new HashMap<String , Object>();
    filterMap.put("size" , sizes);
    Map<String, String> innerMap = new HashMap<>();
    innerMap.put("createdOn", "2017-11-06");
    filterMap.put(">=", innerMap);
    additionalProperties.put(JsonKey.FILTERS,filterMap);
    Map<String, Object> rangeMap = new HashMap<String , Object>();
    rangeMap.put(">",0);
    filterMap.put("pkgVersion" , rangeMap);
    Map<String , Object> lexicalMap = new HashMap<>();
    lexicalMap.put(STARTS_WITH , "type");
    filterMap.put("courseType" , lexicalMap);
    Map<String , Object> lexicalMap1 = new HashMap<>();
    lexicalMap1.put(ENDS_WITH , "sunbird");
    filterMap.put("courseAddedByName" , lexicalMap1);
    //for exact math key value pair
    filterMap.put("orgName" , "Name of the organisation");

    searchDTO.setAdditionalProperties(additionalProperties);
    searchDTO.setQuery("organisation");
    Map map = ElasticSearchUtil.complexSearch(searchDTO,indexName , typeName);
    List response = (List) map.get(JsonKey.RESPONSE);
    assertEquals(2 , map.size());
}
 
开发者ID:project-sunbird,项目名称:sunbird-utils,代码行数:32,代码来源:ElasticSearchUtilTest.java

示例4: testComplexSearchWithRangeLessThan

import org.sunbird.dto.SearchDTO; //导入方法依赖的package包/类
@Test
public void testComplexSearchWithRangeLessThan(){
    SearchDTO searchDTO = new SearchDTO();
    Map<String , Object> additionalProperties = new HashMap<String , Object>();
    List<Integer> sizes = new ArrayList<Integer>();
    sizes.add(10);
    sizes.add(20);
    Map<String , Object> filterMap = new HashMap<String , Object>();
    filterMap.put("size" , sizes);
    Map<String, String> innerMap = new HashMap<>();
    innerMap.put("createdOn", "2017-11-06");
    filterMap.put("<=", innerMap);
    additionalProperties.put(JsonKey.FILTERS,filterMap);
    Map<String, Object> rangeMap = new HashMap<String , Object>();
    rangeMap.put(">",0);
    filterMap.put("pkgVersion" , rangeMap);
    Map<String , Object> lexicalMap = new HashMap<>();
    lexicalMap.put(STARTS_WITH , "type");
    filterMap.put("courseType" , lexicalMap);
    Map<String , Object> lexicalMap1 = new HashMap<>();
    lexicalMap1.put(ENDS_WITH , "sunbird");
    filterMap.put("courseAddedByName" , lexicalMap1);
    //for exact math key value pair
    filterMap.put("orgName" , "Name of the organisation");

    searchDTO.setAdditionalProperties(additionalProperties);
    searchDTO.setQuery("organisation");
    Map map = ElasticSearchUtil.complexSearch(searchDTO,indexName , typeName);
    List response = (List) map.get(JsonKey.RESPONSE);
    assertEquals(2 , map.size());
}
 
开发者ID:project-sunbird,项目名称:sunbird-utils,代码行数:32,代码来源:ElasticSearchUtilTest.java

示例5: testComplexSearch

import org.sunbird.dto.SearchDTO; //导入方法依赖的package包/类
@Test
public void testComplexSearch(){
    SearchDTO searchDTO = new SearchDTO();
    List<String> fields = new ArrayList<String>();
    fields.add("courseId");
    fields.add("courseType");
    fields.add("createdOn");
    fields.add("description");
    List<String> excludefields = new ArrayList<String>();
    excludefields.add("createdOn");
    Map<String , String> sortMap = new HashMap<>();
    sortMap.put("courseType" , "ASC");
    searchDTO.setSortBy(sortMap);
    searchDTO.setExcludedFields(excludefields);
    searchDTO.setLimit(20);
    searchDTO.setOffset(0);
    Map<String,Object> additionalPro = new HashMap<String, Object>();
    searchDTO.addAdditionalProperty("test", additionalPro);
    Map<String , Object> additionalProperties = new HashMap<String , Object>();

    List<String> existsList = new ArrayList<String>();
    existsList.add("pkgVersion");
    existsList.add("size");

    additionalProperties.put(JsonKey.EXISTS , existsList);
    List<String> description = new ArrayList<String>();
    description.add("This is for chemistry");
    description.add("Hindi Jii");
    List<Integer> sizes = new ArrayList<Integer>();
    sizes.add(10);
    sizes.add(20);
    Map<String , Object> filterMap = new HashMap<String , Object>();
    filterMap.put("description" , description);
    filterMap.put("size" , sizes);
    additionalProperties.put(JsonKey.FILTERS,filterMap);
    Map<String, Object> rangeMap = new HashMap<String , Object>();
    rangeMap.put(">",0);
    filterMap.put("pkgVersion" , rangeMap);
    Map<String , Object> lexicalMap = new HashMap<>();
    lexicalMap.put(STARTS_WITH , "type");
    filterMap.put("courseType" , lexicalMap);
    Map<String , Object> lexicalMap1 = new HashMap<>();
    lexicalMap1.put(ENDS_WITH , "sunbird");
    filterMap.put("courseAddedByName" , lexicalMap1);
    //for exact math key value pair
    filterMap.put("orgName" , "Name of the organisation");

    searchDTO.setAdditionalProperties(additionalProperties);
    searchDTO.setFields(fields);
    searchDTO.setQuery("organisation");
    //facets
    List<Map<String,String>> facets = new ArrayList<>();
    Map<String , String> m1 = new HashMap<>();
    m1.put("description" , null);
    m1.put("createdOn", JsonKey.DATE_HISTOGRAM);
    facets.add(m1);
    searchDTO.setFacets(facets);

    //soft constraints
    List<String> mode = Arrays.asList("soft");
    searchDTO.setMode(mode);
    Map<String , Integer> constraintMap = new HashMap<String , Integer>();
    constraintMap.put("grades" , 10);
    constraintMap.put("pkgVersion" , 5);
    searchDTO.setSoftConstraints(constraintMap);
    searchDTO.setQuery("organisation Name published");


    Map map = ElasticSearchUtil.complexSearch(searchDTO,indexName , typeName);

    List response = (List) map.get(JsonKey.RESPONSE);
    assertEquals(3 , map.size());
    //assertNotNull(map);
}
 
开发者ID:project-sunbird,项目名称:sunbird-utils,代码行数:75,代码来源:ElasticSearchUtilTest.java


注:本文中的org.sunbird.dto.SearchDTO.setAdditionalProperties方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。