> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# filter_by_string

<div className="kinetica-pydoc">
  <div className="dl py method">
    <div className="dt sig sig-object py" id="gpudb.GPUdb.filter_by_string"> <span className="sig-name descname"><span className="pre">filter\_by\_string</span></span><span className="sig-paren">(</span><span className="em sig-param"><span className="n"><span className="pre">table\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">view\_name</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">''</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">expression</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">mode</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">column\_names</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">None</span></span></span>, <span className="em sig-param"><span className="n"><span className="pre">options</span></span><span className="o"><span className="pre">=</span></span><span className="default_value"><span className="pre">{"{"}{"}"}</span></span></span><span className="sig-paren">)</span><a href="https://github.com/kineticadb/kinetica-api-python/blob/master/gpudb/gpudb.py#L29973"><span className="viewcode-link"><span className="pre">\[source]</span></span></a></div>

    <div className="dd">
      <p>Calculates which objects from a table or view match a string expression for the given string columns. Setting <span className="em">case\_sensitive</span> can modify case sensitivity in matching for all modes except <span className="em">search</span>. For <span className="em">search</span> mode details and limitations, see <a className="reference external" href="/content/concepts/full_text_search/">Full Text Search</a>.</p>
      <p><strong>Parameters</strong></p>

      <div className="blockquote">
        <div>
          <div className="dl">
            <div className="dt">table\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>Name of the table on which the filter operation will be performed, in \[schema\_name.]table\_name format, using standard <a className="reference external" href="/content/concepts/tables/#table-name-resolution">name resolution rules</a>. Must be an existing table or view.</p>
            </div>

            <div className="dt">view\_name (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>If provided, then this will be the name of the view containing the results, in \[schema\_name.]view\_name format, using standard <a className="reference external" href="/content/concepts/tables/#table-name-resolution">name resolution rules</a> and meeting <a className="reference external" href="/content/concepts/tables/#table-naming-criteria">table naming criteria</a>. Must not be an already existing table or view. The default value is ‘’.</p>
            </div>

            <div className="dt">expression (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>The expression with which to filter the table.</p>
            </div>

            <div className="dt">mode (<span className="em">str</span>) –</div>

            <div className="dd">
              <p>The string filtering mode to apply. See below for details. Allowed values are:</p>

              <ul className="simple">
                <li>
                  <p><strong>search</strong> – Full text search query with wildcards and boolean operators. Note that for this mode, no column can be specified in input parameter <span className="em">column\_names</span>; all string columns of the table that have text search enabled will be searched.</p>
                </li>

                <li>
                  <p><strong>equals</strong> – Exact whole-string match (accelerated).</p>
                </li>

                <li>
                  <p><strong>contains</strong> – Partial substring match (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.</p>
                </li>

                <li>
                  <p><strong>starts\_with</strong> – Strings that start with the given expression (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.</p>
                </li>

                <li>
                  <p><strong>regex</strong> – Full regular expression search (not accelerated). If the column is a string type (non-charN) and the number of records is too large, it will return 0.</p>
                </li>

                <li>
                  <p><strong>search\_stats</strong> – Cross-shard BM25 corpus statistics for one (column, query) pair. Returns the merged BM25 statistics (max\_doc, doc\_count, sum\_total\_term\_freq, per-term doc\_freq / total\_term\_freq) needed by callers that score documents themselves (e.g. text\_match\_bm25\_global SQL function pre-pass). Requires <span className="em">column\_names</span> to contain exactly one column with text search enabled. The <span className="em">view\_name</span> field is ignored — this mode does not produce a result table.</p>
                </li>
              </ul>
            </div>

            <div className="dt">column\_names (<span className="em">list of str</span>) –</div>

            <div className="dd">
              <p>List of columns on which to apply the filter. Ignored for <span className="em">search</span> mode. The user can provide a single element (which will be automatically promoted to a list internally) or a list.</p>
            </div>

            <div className="dt">options (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Optional parameters. Allowed keys are:</p>

              <ul>
                <li>
                  <p><strong>create\_temp\_table</strong> – If <span className="em">true</span>, a unique temporary table name will be generated in the sys\_temp schema and used in place of input parameter <span className="em">view\_name</span>. This is always allowed even if the caller does not have permission to create tables. The generated name is returned in <span className="em">qualified\_view\_name</span>. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘false’.</p>
                </li>

                <li>
                  <p><strong>collection\_name</strong> – \[DEPRECATED–please specify the containing schema for the view as part of input parameter <span className="em">view\_name</span> and use <a className="reference internal" href="#gpudb.GPUdb.create_schema" title="gpudb.GPUdb.create_schema"><code className="xref py py-meth docutils literal notranslate"><span className="pre">GPUdb.create\_schema()</span></code></a> to create the schema if non-existent] Name of a schema for the newly created view. If the schema is non-existent, it will be automatically created.</p>
                </li>

                <li>
                  <p><strong>case\_sensitive</strong> – If <span className="em">false</span> then string filtering will ignore case. Does not apply to <span className="em">search</span> mode. Allowed values are:</p>

                  <ul className="simple">
                    <li>
                      <p>true</p>
                    </li>

                    <li>
                      <p>false</p>
                    </li>
                  </ul>

                  <p>The default value is ‘true’.</p>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>
          </div>
        </div>
      </div>

      <p><strong>Returns</strong></p>

      <div className="blockquote">
        <div>
          <p>A dict with the following entries–</p>

          <div className="dl">
            <div className="dt">count (<span className="em">long</span>) –</div>

            <div className="dd">
              <p>The number of records that passed the string filter.</p>
            </div>

            <div className="dt">info (<span className="em">dict of str to str</span>) –</div>

            <div className="dd">
              <p>Additional information. Allowed keys are:</p>

              <ul className="simple">
                <li>
                  <p><strong>qualified\_view\_name</strong> – The fully qualified name of the view (i.e. including the schema).</p>
                </li>
              </ul>

              <p>The default value is an empty dict ( {"{"}{"}"} ).</p>
            </div>

            <div className="dt">stats\_data (<span className="em">bytes</span>) –</div>

            <div className="dd">
              <p>Serialized cross-shard BM25 corpus statistics, populated for <span className="em">search\_stats</span> mode and empty otherwise. Wire format matches the merged BM25GlobalStats blob the BM25 stats worker produces internally (max\_doc, doc\_count, sum\_total\_term\_freq, sum\_doc\_freq, num\_terms, then per term: term, doc\_freq, total\_term\_freq). Clients that consume this perform their own scoring; the gpudb client library will expose a parser as a future convenience. The default value is ‘’.</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
