Note that there are some explanatory texts on larger screens.

plurals
  1. POSphinx 2.0.2 Filtering sql_attr_string Attributes
    text
    copied!<p>Firstly, let me say that I know that <a href="http://sphinxsearch.com/docs/current.html#conf-sql-attr-string" rel="nofollow">http://sphinxsearch.com/docs/current.html#conf-sql-attr-string</a> says "strings can only be used for storage and retrieval" and that "They can not participate in expressions, be used for filtering, sorting, or grouping"...</p> <p>Having said that, using Sphinx 2.0.2, accessing the index via both the SQL interface (on port 9306) as well as via SphinxSE I am able to sort, at least, on a string attribute I have.</p> <p>So although that doesn't necessarily mean that the documentation is completely wrong, it does leave me with a small amount of hope that I can filter by that string attribute, too.</p> <p>Unfortunately I don't know if I can, and if I can, I don't know how.</p> <p>Can someone here please put me out of my misery? </p> <p>[EDIT]</p> <p>The attribute is 'mail_street_name' and I've tried filtering it a number of ways. Trying to filter on 'box', for example, in the SphinxSE query string I've tried <code>filter=mail_street_name,box</code>, <code>filter=mail_street_name,"box"</code> and <code>filter=mail_street_name,\'box\'</code> (escaped because it sits inside a string). These queries result in no change to the result set (as if I didn't try and filter on that attribute at all).</p> <p>With the MySQL connection on port 9306 I've tried <code>WHERE mail_street_name='box'</code>, <code>WHERE mail_street_name="box"</code>, <code>WHERE mail_street_name=box</code> and using <code>LIKE</code> instead of <code>=</code>, all to be given a syntax error (Error 1064 (42000)) from SphinxQL.</p> <p>Many thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload