title: Custom filter to search criteria. Magento 2
body: <p>I need to add range filter for year. I redefine the Magento class in my module FullText\Collection. I also made changes in search_request.xml file. I found the code and it works for me:</p>
  
  <p>$skus = [
              'CNS334',
              'U012840'
          ];</p>
  
  <pre><code>    $this-&gt;filterBuilder-&gt;setField('sku');
      $this-&gt;filterBuilder-&gt;setValue($skus);
      $this-&gt;filterBuilder-&gt;setConditionType('in');
  
      $this-&gt;searchCriteriaBuilder-&gt;addFilter($this-&gt;filterBuilder-&gt;create());
  </code></pre>
  
  <p>But I have data in the another tables. I try to join, but I cant get any results for my filtering. </p>
  
  <pre><code>   $this-&gt;getSelect()-&gt;join(
          [
              'my' =&gt; 'make_year',
          ],
          'e.entity_id = my.product_id'
  
  $this-&gt;searchCriteriaBuilder-&gt;addFilter($this-&gt;filterBuilder
          -&gt;setField('year')
          -&gt;setValue(2014)
          -&gt;setConditionType('from')
          -&gt;create());
  
  $this-&gt;searchCriteriaBuilder-&gt;addFilter($this-&gt;filterBuilder
          -&gt;setField('year')
          -&gt;setValue(2015)
          -&gt;setConditionType('to')
          -&gt;create());
  
      $this-&gt;searchCriteriaBuilder-&gt;addFilter($this-&gt;filterBuilder-&gt;create());
  </code></pre>