Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you have a database at Heroku, you can use Postgres's support for Full Text Search: <a href="http://www.postgresql.org/docs/8.3/static/textsearch.html" rel="nofollow">http://www.postgresql.org/docs/8.3/static/textsearch.html</a>. The oldest servers Heroku runs (for shared databases) are on 8.3 and 8.4. The newest are on 9.0.</p> <p>A blog post noticing this little fact can be seen here: <a href="https://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku.html" rel="nofollow">https://tenderlovemaking.com/2009/10/17/full-text-search-on-heroku.html</a></p> <p>Apparently, that "texticle" (heh. cute.) addon works...pretty well. It will even create the right indexes for you, as I understand it.</p> <p>Here's the underlying story: postgres full-text-search is pretty fast and fuss-free (although Rails-integration may not be great), although it does not offer the bells and whistles of Solr or IndexTank. Make sure you read about how to properly set up GIN and/or GiST indexes, and use the tsvector/tsquery types.</p> <p>The short version:</p> <ul> <li>Create an (in this case, expression-based) index: <code>CREATE INDEX pgweb_idx ON pgweb USING gin(to_tsvector('english', body));</code>. In this case "body" is the field being indexed.</li> <li>Use the <code>@@</code> operator: <code>SELECT * FROM ... WHERE to_tsvector('english', pgweb.body) @@ to_tsquery('hello &amp; world') LIMIT 30</code></li> </ul> <p>The hard part may be mapping things back into application land, the blog post previously cited is trying to do that.</p> <p>The dedicated databases can also be requisitioned with PostGIS, which is a very powerful and fully featured system for indexing and querying geographical data. OpenStreetMap uses the PostgreSQL geometry types (built-in) extensively, and many people combine that with PostGIS to great effect.</p> <p>Both of these (full text search, PostGIS) take advantage of the extensible data type and indexing infrastructure in Postgres, so you should expect them to work with high performance for many, many records (spend a little time carefully reviewing the situation if things look busted). You might also take advantage of fact that you are able to leverage these features in combination with transactions and structured data. For example:</p> <p><code>CREATE TABLE products (pk bigserial, price numeric, quantity integer, description text);</code> can just as easily be used with full text search...any text field will do, and it can be in connection with regular attributes (price, quantity in this case).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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