public void should_construct_builder() { var query = new StringQuery("Name", "文档", OccurType.Should) .Next(new RangeQuery("UpdateTime", "2015-10-11", "2015-2-1", OccurType.Must)) .Next(new StringQuery("Content", "文档", OccurType.Should)); var rule = query.GetRule(); }
public void test_write_documents_with_query_condition_with_different_documentType() { WriteSpace("spaces"); var query = new StringQuery("Name", "空间", OccurType.Should); query.Next(new StringQuery("DocumentType", DocumentType.Word.ToString(), OccurType.Must)); var results = _provider.Query<SearchResult>(query); Assert.AreEqual(results.Count, 0); }
public void test_write_documents_with_query_and_fields() { WriteSpace("spaces"); var query = new StringQuery("Name", "空间", OccurType.Should); query.Next(new StringQuery("DocumentType", DocumentType.Folder.ToString(), OccurType.Must)); var results = _provider.Query<DocumentSearchResult>(query); Assert.AreEqual(results.Count, 2); }
public void test_write_documents_with_query_condition_with_incorrect_name() { WriteSpace("spaces"); var query = new StringQuery("Name", "unknow", OccurType.Should); var query2 = new StringQuery("Content", "unkonw", OccurType.Should); var orQuery = new OrQuery(query, query2, OccurType.Must); orQuery.Next(new StringQuery("DocumentType", DocumentType.Folder.ToString(), OccurType.Must)); var results = _provider.Query<DocumentSearchResult>(orQuery); Assert.AreEqual(results.Count, 0); }
public void test_write_documents_with_query_condition_with_range_begin_end() { WriteSpace("spaces"); var query = new StringQuery("Name", "空间", OccurType.Should); query.Next(new RangeQuery("UpdateTime", "20140521", "20140622", OccurType.Must)); var results = _provider.Query<DocumentSearchResult>(query, 0, 1); Assert.AreEqual(results.Count, 1); }
public void test_write_spaces_with_keyword_with_should_occurType() { WriteSpace("spaces"); var query = new StringQuery("Name", "空间"); query.Next(new StringQuery("Content", "空间", OccurType.Should)); var results = _provider.Query<DocumentSearchResult>(query); Assert.AreEqual(results.Count, 2); }
public void test_query_write_with_querybuilder_match_one_condition() { var query = new StringQuery("Name", "报价明细表"); var query2 = new StringQuery("Content", "unknowNamemyff"); var orQuery = new OrQuery(query, query2, OccurType.Must); orQuery.Next(new StringQuery("DocumentType", DocumentType.Excel.ToString(), OccurType.Must)); var results = _provider.Query<DocumentSearchResult>(orQuery); Assert.AreEqual(results.Count, 1); }
public void test_query_write_with_querybuilder_with_documentType() { var query = new StringQuery("Name", "智慧市政", OccurType.Should); query.Next(new StringQuery("DocumentType", DocumentType.Folder.ToString(), OccurType.Must)); var results = _provider.Query<DocumentSearchResult>(query); Assert.AreEqual(results.Count, 1); }
public void test_write_spaces_with_keyword_with_range_begin_end() { var query = new StringQuery("Name", "智慧市政", OccurType.Should); query.Next(new StringQuery("DocumentType", DocumentType.Folder.ToString(), OccurType.Must)) .Next(new RangeQuery("UpdateTime", "20140721", "20141221", OccurType.Must)); var results = _provider.Query<DocumentSearchResult>(query); Assert.AreEqual(results.Count, 1); }
public void test_query_write_with_querybuilder() { var query = new StringQuery("Name", "智慧市政", OccurType.Should); var results = _provider.Query<DocumentSearchResult>(query); Assert.IsTrue(results.Count>= 3); }
public void test_write_documents_with_query_condition_with_range_begin_end_start_startIndex() { var query = new StringQuery("Name", "智慧市政", OccurType.Should); query.Next(new RangeQuery("UpdateTime", "20140721", "20141221", OccurType.Must)); var results = _provider.Query<DocumentSearchResult>(query, 0, 1); Assert.AreEqual(results.Count, 1); }
public void test_write_documents_with_query_condition_with_null_range_begin_end() { var query = new StringQuery("Name", "智慧市政", OccurType.Should); query.Next(new RangeQuery(null, null, null, OccurType.Should)); var results = _provider.Query<DocumentSearchResult>(query); Assert.AreEqual(results.Count, 3); }
public void test_write_documents_with_query_condition_with_documentType_null() { var query = new StringQuery("Name", "报价明细表", OccurType.Should); var query2 = new StringQuery("Content", "报价明细表", OccurType.Should); var orQuery = new OrQuery(query, query2, OccurType.Must); orQuery.Next(new StringQuery(null, null, OccurType.Must)); var results = _provider.Query<DocumentSearchResult>(orQuery); Assert.AreEqual(results.Count, 1); }
public void test_write_documents_with_query_condition_with_all_query_empty() { var query = new StringQuery(string.Empty, string.Empty, OccurType.Should); var query2 = new StringQuery(string.Empty, string.Empty, OccurType.Should); var orQuery = new OrQuery(query, query2, OccurType.Must); orQuery.Next(new StringQuery(string.Empty, string.Empty, OccurType.Must)); var results = _provider.Query<DocumentSearchResult>(orQuery); Assert.AreEqual(results.Count, 0); }
public void test_write_documents_with_query_and_fields() { var query = new StringQuery("Name", "报价明细表", OccurType.Should); query.Next(new StringQuery("DocumentType", DocumentType.Excel.ToString(), OccurType.Should)); var results = _provider.Query<DocumentSearchResult>(query); Assert.AreEqual(results.Count, 1); }