Package com.tistory.devyongsik.crescent.index.entity

Examples of com.tistory.devyongsik.crescent.index.entity.IndexingRequestForm


  }

  private void indexingTestData() {
   
    Handler handler = new JsonDataHandler();
    IndexingRequestForm indexingRequestForm = handler.handledData(bulkIndexingTestText);
    CrescentCollections crescentCollections = collectionHandler.getCrescentCollections();
    CrescentCollection collection = crescentCollections.getCrescentCollection("sample");
   
    String message = executor.indexing(collection, indexingRequestForm);
View Full Code Here


  @Test
  public void indexingAddDocumentBulk() {
    String inputText = FormattedTextBuilder.getAddDocBulkJsonForm();
   
    ObjectMapper mapper = new ObjectMapper();
    IndexingRequestForm indexingRequest = null;
    try {
      indexingRequest = mapper.readValue(inputText, IndexingRequestForm.class);
    } catch (IOException e) {
      Assert.fail(e.getMessage());
    }
   
    Assert.assertEquals("add", indexingRequest.getCommand());
    Assert.assertEquals(null, indexingRequest.getQuery());
    Assert.assertEquals("bulk", indexingRequest.getIndexingType());
    Assert.assertEquals("[{board_id=0, title=제목 입니다0, dscr=본문 입니다.0, creuser=test}]",
        indexingRequest.getDocumentList().toString());
  }
View Full Code Here

  @Test
  public void indexingAddDocumentIncrement() {
    String inputText = FormattedTextBuilder.getAddDocIncJsonForm();
   
    ObjectMapper mapper = new ObjectMapper();
    IndexingRequestForm indexingRequest = null;
    try {
      indexingRequest = mapper.readValue(inputText, IndexingRequestForm.class);
    } catch (IOException e) {
      Assert.fail(e.getMessage());
    }
   
    Assert.assertEquals("add", indexingRequest.getCommand());
    Assert.assertEquals(null, indexingRequest.getQuery());
    Assert.assertEquals("incremental", indexingRequest.getIndexingType());
    Assert.assertEquals("[{board_id=0, title=제목 입니다0, dscr=본문 입니다.0, creuser=test}]",
        indexingRequest.getDocumentList().toString());
  }
View Full Code Here

  @Test
  public void indexingUpdateDocumentBulk() {
    String inputText = FormattedTextBuilder.getUpdateDocBulkJsonForm();
   
    ObjectMapper mapper = new ObjectMapper();
    IndexingRequestForm indexingRequest = null;
    try {
      indexingRequest = mapper.readValue(inputText, IndexingRequestForm.class);
    } catch (IOException e) {
      Assert.fail(e.getMessage());
    }
   
    Assert.assertEquals("update", indexingRequest.getCommand());
    Assert.assertEquals("creuser:test", indexingRequest.getQuery());
    Assert.assertEquals("bulk", indexingRequest.getIndexingType());
    Assert.assertEquals("[{board_id=0, title=제목 입니다0 업데이트..., dscr=본문 입니다.0, creuser=test}]",
        indexingRequest.getDocumentList().toString());
  }
View Full Code Here

  @Test
  public void indexingUpdateDocumentInc() {
    String inputText = FormattedTextBuilder.getUpdateDocIncJsonForm();
   
    ObjectMapper mapper = new ObjectMapper();
    IndexingRequestForm indexingRequest = null;
    try {
      indexingRequest = mapper.readValue(inputText, IndexingRequestForm.class);
    } catch (IOException e) {
      Assert.fail(e.getMessage());
    }
   
   
    Assert.assertEquals("update", indexingRequest.getCommand());
    Assert.assertEquals("creuser:test", indexingRequest.getQuery());
    Assert.assertEquals("incremental", indexingRequest.getIndexingType());
    Assert.assertEquals("[{board_id=0, title=제목 입니다0 업데이트..., dscr=본문 입니다.0, creuser=test}]",
        indexingRequest.getDocumentList().toString());
  }
View Full Code Here

  @Test
  public void indexingDeleteDocumentBulk() {
    String inputText = FormattedTextBuilder.getDeleteDocBulkJsonForm();
   
    ObjectMapper mapper = new ObjectMapper();
    IndexingRequestForm indexingRequest = null;
    try {
      indexingRequest = mapper.readValue(inputText, IndexingRequestForm.class);
    } catch (IOException e) {
      Assert.fail(e.getMessage());
    }
   
    Assert.assertEquals("delete", indexingRequest.getCommand());
    Assert.assertEquals("creuser:test", indexingRequest.getQuery());
    Assert.assertEquals("bulk", indexingRequest.getIndexingType());
    Assert.assertEquals(null, indexingRequest.getDocumentList());
  }
View Full Code Here

  @Test
  public void indexingDeleteDocumentInc() {
    String inputText = FormattedTextBuilder.getDeleteDocIncJsonForm();
   
    ObjectMapper mapper = new ObjectMapper();
    IndexingRequestForm indexingRequest = null;
    try {
      indexingRequest = mapper.readValue(inputText, IndexingRequestForm.class);
    } catch (IOException e) {
      Assert.fail(e.getMessage());
    }
   
    Assert.assertEquals("delete", indexingRequest.getCommand());
    Assert.assertEquals("creuser:test", indexingRequest.getQuery());
    Assert.assertEquals("incremental", indexingRequest.getIndexingType());
    Assert.assertEquals(null, indexingRequest.getDocumentList());
  }
View Full Code Here

  public IndexingRequestForm handledData(String jsonFormStr) {
   
    try {
      ObjectMapper mapper = new ObjectMapper();
     
      IndexingRequestForm indexingRequestForm = mapper.readValue(jsonFormStr, IndexingRequestForm.class);
     
      return indexingRequestForm;
     
    } catch (IOException e) {
      logger.error("error : ", e);
View Full Code Here

        text.append(tmp);
        //logger.info(tmp);
      }
     
      reader.close();
      IndexingRequestForm indexingRequestForm = handler.handledData(text.toString());
     
//      CrescentCollectionHandler collectionHandler
//        = SpringApplicationContext.getBean("crescentCollectionHandler", CrescentCollectionHandler.class);
     
      CrescentCollection collection = collectionHandler.getCrescentCollections().getCrescentCollection(collectionName);
View Full Code Here

    Map<String, CrescentCollection> collections = crescentCollections.getCrescentCollectionsMap();

    CrescentCollection sampleCollection = collections.get("sample");

    Handler handler = new JsonDataHandler();
    IndexingRequestForm indexingRequestForm = handler.handledData(FormattedTextBuilder.getAddDocBulkJsonForm());
   
    String returnMessage = executor.indexing(sampleCollection, indexingRequestForm);
   
    Assert.assertEquals("1건의 색인이 완료되었습니다.", returnMessage);
  }
View Full Code Here

TOP

Related Classes of com.tistory.devyongsik.crescent.index.entity.IndexingRequestForm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.