title: How to create NetSuite SuiteTalk search with multiple terms?
body: <p>How does one create a SuiteTalk (NetSuite web api) search query specifying multiple search terms indicating a logical OR operator?</p>
  
  <p>For example, I want to retrieve TimeBill records whose <em>create</em> OR <em>last modified dates</em> are within a particular range. Here's my code that works great for a single search term. Simply adding another search term appears to create a logical AND operation.</p>
  
  <pre><code>    /// &lt;summary&gt;
      /// Return the list of time bills whose last modified date is within 
      /// the indicated date range.
      /// &lt;/summary&gt;
      /// &lt;param name="from"&gt;Required from date&lt;/param&gt;
      /// &lt;param name="to"&gt;Optional to date&lt;/param&gt;
      /// &lt;returns&gt;List of time bills&lt;/returns&gt;
      public IEnumerable&lt;TimeBill&gt; GetTimeBills(DateTime from, DateTime to)
      {
          _log.Debug(String.Format("Enter TimeBill(DateTime from='{0}', DateTime to='{1}')", from, to));
  
          // Build search criteria.
          TimeBillSearch search = new TimeBillSearch();
          TimeBillSearchBasic searchBasic = new TimeBillSearchBasic();
          SearchDateField searchDateField = new SearchDateField();
          searchDateField.@operator = SearchDateFieldOperator.within;
          searchDateField.operatorSpecified = true;
          searchDateField.searchValue = from;
          searchDateField.searchValueSpecified = true;
          searchDateField.searchValue2 = to;
          searchDateField.searchValue2Specified = true;
          searchBasic.dateCreated = searchDateField;            
          search.basic = searchBasic;
  
          return this.Get&lt;TimeBill&gt;(search);
      }  
  
      /// &lt;summary&gt;
      /// Perform a paged search and convert the returned record to the indicated type.
      /// &lt;/summary&gt;
      private IEnumerable&lt;T&gt; Get&lt;T&gt;(SearchRecord searchRecord)
      {
          _log.Debug("Enter Get&lt;T&gt;(SearchRecord searchRecord)");
  
          // This is returned.
          List&lt;T&gt; list = new List&lt;T&gt;();
  
          // The suitetalk service return this.
          SearchResult result = null;
  
          using (ISuiteTalkService service = SuiteTalkFactory.Get&lt;SuiteTalkService&gt;())
          {
              do
              {
                  // .search returns the first page of data.
                  if (result == null)
                  {
                      result = service.search(searchRecord);
                  }
                  else // .searchMore returns the next page(s) of data.
                  {
                      result = service.searchMoreWithId(result.searchId, result.pageIndex + 1);
                  }
  
                  if (result.status.isSuccess)
                  {
                      foreach (Record record in result.recordList)
                      {
                          if (record is T)
                          {
                              list.Add((T)Convert.ChangeType(record, typeof(T)));
                          }
                      }
                  }
              }
              while (result.pageIndex &lt; result.totalPages);
          }
          return list;
      }
  </code></pre>