Package com.tistory.devyongsik.crescent.search.entity

Examples of com.tistory.devyongsik.crescent.search.entity.SearchRequest


    super.init();
  }

  @Test
  public void keywordParse() throws CrescentInvalidRequestException {
    SearchRequest searchRequest = new SearchRequest();
    searchRequest.setCollectionName("sample");
    searchRequest.setKeyword("나이키청바지");
   
    CrescentSearchRequestWrapper csrw
      = new CrescentSearchRequestWrapper(searchRequest);
   
    Query query = csrw.getQuery();
View Full Code Here


    super.init();
  }
 
  @Test
  public void search() throws IOException {
    SearchRequest searchRequest = new SearchRequest();
    searchRequest.setKeyword("1");
    searchRequest.setCollectionName("sample");
   
    CrescentSearchRequestWrapper csrw = new CrescentSearchRequestWrapper(searchRequest);
   
    SearchResult searchResult = crescentDocSearcher.search(csrw);
   
View Full Code Here

    super.init();
  }
 
  @Test
  public void search() throws IOException {
    SearchRequest searchRequest = new SearchRequest();
    searchRequest.setCollectionName("sample");
    searchRequest.setKeyword("1");
   
    SearchResult searchResult = searchService.search(searchRequest);
   
    Assert.assertTrue(searchResult.getTotalHitsCount() > 0)
  }
View Full Code Here

 
  private static SearchRequest searchRequest;

  @Before
  public void initParamMap() {
    searchRequest = new SearchRequest();
    searchRequest.setCollectionName("sample");
  }
View Full Code Here

    Assert.assertEquals("청바지", searchRequestWrapper.getKeyword());
  }
 
  @Test
  public void getFilter() throws CrescentInvalidRequestException {
    SearchRequest searchRequest = new SearchRequest();
    searchRequest.setCollectionName("sample");
    searchRequest.setFilter("title:\"파이썬 프로그래밍 공부\" +dscr:\"자바 병렬 프로그래밍\"");
   
    CrescentSearchRequestWrapper csrw
      = new CrescentSearchRequestWrapper(searchRequest);
   
    Filter filter = csrw.getFilter();
View Full Code Here

    Assert.assertEquals("QueryWrapperFilter(title:파이썬^2.0 title:파이^2.0 title:프로그래밍^2.0 title:공부^2.0 +dscr:자바 +dscr:병렬 +dscr:프로그래밍)", filter.toString());
  }
 
  @Test
  public void getQuery() throws CrescentInvalidRequestException {
    SearchRequest searchRequest = new SearchRequest();
    searchRequest.setCollectionName("sample");
    searchRequest.setCustomQuery("title:\"파이썬 프로그래밍 공부\" +dscr:\"자바 병렬 프로그래밍\"");
   
    CrescentSearchRequestWrapper csrw
      = new CrescentSearchRequestWrapper(searchRequest);
   
    Query query = csrw.getQuery();
View Full Code Here

        //IndexReader reader = IndexReader.open(indexWriter, true);
        //IndexSearcher searcher = new IndexSearcher(reader);
        //TopDocs topDocs = searcher.search(new TermQuery(new Term("_id", "1")), 1);
    SearchRequest searchRequest = new SearchRequest();
    searchRequest.setKeyword("입니다");
    searchRequest.setCollectionName("sample");
    searchRequest.setSearchField("title,dscr");

    //IndexWriterManager indexWriterManager = IndexWriterManager.getIndexWriterManager();
    //IndexWriter indexWriter = indexWriterManager.getIndexWriter("sample");
    //IndexReader indexReader = IndexReader.open(indexWriter, true);
   
View Full Code Here

    super.init();
  }

  @Test
  public void rangeQuery() throws CrescentInvalidRequestException {
    SearchRequest searchRequest = new SearchRequest();
    searchRequest.setCollectionName("sample");
    searchRequest.setCustomQuery("board_id:\"[10 TO 100000]\"");
   
    CrescentSearchRequestWrapper csrw
      = new CrescentSearchRequestWrapper(searchRequest);
   
    Query query = csrw.getQuery();
View Full Code Here

    Assert.assertEquals("board_id:[10 TO 100000]", query.toString());
  }
 
  @Test(expected = CrescentInvalidRequestException.class)
  public void rangeQueryNoSearchField() throws CrescentInvalidRequestException {
    SearchRequest searchRequest = new SearchRequest();
    searchRequest.setCollectionName("sample");
    searchRequest.setCustomQuery("field1:\"[10 TO 100000]\"");
   
    CrescentSearchRequestWrapper csrw
      = new CrescentSearchRequestWrapper(searchRequest);
   
    Query query = csrw.getQuery();
View Full Code Here

   
  }
 
  @Test
  public void normalTermQuery() throws CrescentInvalidRequestException {
    SearchRequest searchRequest = new SearchRequest();
    searchRequest.setCollectionName("sample");
    searchRequest.setCustomQuery("dscr:\"파이썬 프로그래밍 공부\"");
   
    CrescentSearchRequestWrapper csrw
      = new CrescentSearchRequestWrapper(searchRequest);
   
    Query query = csrw.getQuery();
View Full Code Here

TOP

Related Classes of com.tistory.devyongsik.crescent.search.entity.SearchRequest

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.