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_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_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_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); }